POST api/referral/update

Updates referrals in a referral program. For each referral, a query object is specified to identify the referral to update and a referral object is specified to identify the elements to update. At a minimum, a query object requires either a valid value in primaryInfo or a valid element in both the secondaryInfo and tertiaryInfo elements. A referral will only be updated if it can be uniquely identifier by the query.

Request Information

URI Parameters

Query String:

None.

Body Parameters

A list of structures containing details about the referral to update

Type: Collection of UpdateReferralInfo

NameDescriptionTypeAdditional information
query

A structure containing details to indentify a referral to update

ReferralQuery

None.

referral

A structure containing the elements of a referral to update.

UpdateReferral

None.

Request Formats

application/json, text/json

Sample:
[
  {
    "query": {
      "primaryInfo": {
        "referralId": "sample string 1"
      },
      "secondaryInfo": {
        "externalIdentifier": "sample string 1",
        "email": "sample string 2",
        "phoneNumber": "sample string 3"
      },
      "tertiaryInfo": {
        "ProgramId": "sample string 1",
        "ProgramName": "sample string 2",
        "ProgramTitle": "sample string 3"
      }
    },
    "referral": {
      "firstName": "sample string 1",
      "lastName": "sample string 2",
      "email": "sample string 3",
      "phoneNumber": "sample string 4",
      "preferredContact": "sample string 5",
      "externalIdentifier": "sample string 6",
      "amount": 1.0,
      "companyName": "sample string 7"
    }
  },
  {
    "query": {
      "primaryInfo": {
        "referralId": "sample string 1"
      },
      "secondaryInfo": {
        "externalIdentifier": "sample string 1",
        "email": "sample string 2",
        "phoneNumber": "sample string 3"
      },
      "tertiaryInfo": {
        "ProgramId": "sample string 1",
        "ProgramName": "sample string 2",
        "ProgramTitle": "sample string 3"
      }
    },
    "referral": {
      "firstName": "sample string 1",
      "lastName": "sample string 2",
      "email": "sample string 3",
      "phoneNumber": "sample string 4",
      "preferredContact": "sample string 5",
      "externalIdentifier": "sample string 6",
      "amount": 1.0,
      "companyName": "sample string 7"
    }
  }
]

application/xml, text/xml

Sample:
<ArrayOfupdateReferral xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <updateReferral>
    <query>
      <primaryInfo>
        <referralId>sample string 1</referralId>
      </primaryInfo>
      <secondaryInfo>
        <email>sample string 2</email>
        <externalIdentifier>sample string 1</externalIdentifier>
        <phoneNumber>sample string 3</phoneNumber>
      </secondaryInfo>
      <tertiaryInfo xmlns:d4p1="http://schemas.datacontract.org/2004/07/ReferralRock.Api.Models">
        <d4p1:ProgramId>sample string 1</d4p1:ProgramId>
        <d4p1:ProgramName>sample string 2</d4p1:ProgramName>
        <d4p1:ProgramTitle>sample string 3</d4p1:ProgramTitle>
      </tertiaryInfo>
    </query>
    <referral>
      <firstName>sample string 1</firstName>
      <lastName>sample string 2</lastName>
      <email>sample string 3</email>
      <phoneNumber>sample string 4</phoneNumber>
      <preferredContact>sample string 5</preferredContact>
      <externalIdentifier>sample string 6</externalIdentifier>
      <amount>1</amount>
      <companyName>sample string 7</companyName>
    </referral>
  </updateReferral>
  <updateReferral>
    <query>
      <primaryInfo>
        <referralId>sample string 1</referralId>
      </primaryInfo>
      <secondaryInfo>
        <email>sample string 2</email>
        <externalIdentifier>sample string 1</externalIdentifier>
        <phoneNumber>sample string 3</phoneNumber>
      </secondaryInfo>
      <tertiaryInfo xmlns:d4p1="http://schemas.datacontract.org/2004/07/ReferralRock.Api.Models">
        <d4p1:ProgramId>sample string 1</d4p1:ProgramId>
        <d4p1:ProgramName>sample string 2</d4p1:ProgramName>
        <d4p1:ProgramTitle>sample string 3</d4p1:ProgramTitle>
      </tertiaryInfo>
    </query>
    <referral>
      <firstName>sample string 1</firstName>
      <lastName>sample string 2</lastName>
      <email>sample string 3</email>
      <phoneNumber>sample string 4</phoneNumber>
      <preferredContact>sample string 5</preferredContact>
      <externalIdentifier>sample string 6</externalIdentifier>
      <amount>1</amount>
      <companyName>sample string 7</companyName>
    </referral>
  </updateReferral>
</ArrayOfupdateReferral>

Response Information

Resource Description

[HTTP Status 200 - OK]

Type: Collection of UpdateReferralInfo

NameDescriptionTypeAdditional information
query

A structure containing details to indentify a referral to update

ReferralQuery

None.

referral

A structure containing the elements of a referral to update.

UpdateReferral

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "query": {
      "primaryInfo": {
        "referralId": "sample string 1"
      },
      "secondaryInfo": {
        "externalIdentifier": "sample string 1",
        "email": "sample string 2",
        "phoneNumber": "sample string 3"
      },
      "tertiaryInfo": {
        "ProgramId": "sample string 1",
        "ProgramName": "sample string 2",
        "ProgramTitle": "sample string 3"
      }
    },
    "referral": {
      "firstName": "sample string 1",
      "lastName": "sample string 2",
      "email": "sample string 3",
      "phoneNumber": "sample string 4",
      "preferredContact": "sample string 5",
      "externalIdentifier": "sample string 6",
      "amount": 1.0,
      "companyName": "sample string 7"
    }
  },
  {
    "query": {
      "primaryInfo": {
        "referralId": "sample string 1"
      },
      "secondaryInfo": {
        "externalIdentifier": "sample string 1",
        "email": "sample string 2",
        "phoneNumber": "sample string 3"
      },
      "tertiaryInfo": {
        "ProgramId": "sample string 1",
        "ProgramName": "sample string 2",
        "ProgramTitle": "sample string 3"
      }
    },
    "referral": {
      "firstName": "sample string 1",
      "lastName": "sample string 2",
      "email": "sample string 3",
      "phoneNumber": "sample string 4",
      "preferredContact": "sample string 5",
      "externalIdentifier": "sample string 6",
      "amount": 1.0,
      "companyName": "sample string 7"
    }
  }
]

application/xml, text/xml

Sample:
<ArrayOfupdateReferral xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <updateReferral>
    <query>
      <primaryInfo>
        <referralId>sample string 1</referralId>
      </primaryInfo>
      <secondaryInfo>
        <email>sample string 2</email>
        <externalIdentifier>sample string 1</externalIdentifier>
        <phoneNumber>sample string 3</phoneNumber>
      </secondaryInfo>
      <tertiaryInfo xmlns:d4p1="http://schemas.datacontract.org/2004/07/ReferralRock.Api.Models">
        <d4p1:ProgramId>sample string 1</d4p1:ProgramId>
        <d4p1:ProgramName>sample string 2</d4p1:ProgramName>
        <d4p1:ProgramTitle>sample string 3</d4p1:ProgramTitle>
      </tertiaryInfo>
    </query>
    <referral>
      <firstName>sample string 1</firstName>
      <lastName>sample string 2</lastName>
      <email>sample string 3</email>
      <phoneNumber>sample string 4</phoneNumber>
      <preferredContact>sample string 5</preferredContact>
      <externalIdentifier>sample string 6</externalIdentifier>
      <amount>1</amount>
      <companyName>sample string 7</companyName>
    </referral>
  </updateReferral>
  <updateReferral>
    <query>
      <primaryInfo>
        <referralId>sample string 1</referralId>
      </primaryInfo>
      <secondaryInfo>
        <email>sample string 2</email>
        <externalIdentifier>sample string 1</externalIdentifier>
        <phoneNumber>sample string 3</phoneNumber>
      </secondaryInfo>
      <tertiaryInfo xmlns:d4p1="http://schemas.datacontract.org/2004/07/ReferralRock.Api.Models">
        <d4p1:ProgramId>sample string 1</d4p1:ProgramId>
        <d4p1:ProgramName>sample string 2</d4p1:ProgramName>
        <d4p1:ProgramTitle>sample string 3</d4p1:ProgramTitle>
      </tertiaryInfo>
    </query>
    <referral>
      <firstName>sample string 1</firstName>
      <lastName>sample string 2</lastName>
      <email>sample string 3</email>
      <phoneNumber>sample string 4</phoneNumber>
      <preferredContact>sample string 5</preferredContact>
      <externalIdentifier>sample string 6</externalIdentifier>
      <amount>1</amount>
      <companyName>sample string 7</companyName>
    </referral>
  </updateReferral>
</ArrayOfupdateReferral>