[HTTP POST] ~/contactLists/{contactListId}/registerDevice

Description: Create/Update a contact in a specific ContactList, and store their DeviceID in the ContactDevice table

Request Information

URI Parameters

NameDescriptionTypeAdditional information
contactListId

integer

Required

QueryString Parameters

Custom Events

This Endpoint supports executing Custom Events after it Inserts/Updates Contacts.

You can execute custom events by adding a 'customevents' parameter with a comma-seperated list of Custom Event names to the Request's QueryString.

For Example: If you'd like to run the SendWelcomeEmail and SendEventInvite Custom Events with the contacts that have been successfully inserted/updated via this Call, you can do so via:

contactLists/{contactListId}/registerDevice + "?customevents=SendWelcomeEmail,SendEventInvite"

Match Values

This Endpoint supports updating all Contacts within a given ContactList who have properties that match a given set values.

You can specify what values to match on by adding the following to the Request's QueryString:

  • Adding 'match' parameter with a comma-seperated list of the PropertyNames to match on.
  • If using a PATCH call - by Adding each PropertyName and required value to match upon.
  • If using a POST/PUT call, make sure the specified PropertyName is a property of the ContactDTO that's being passed as part of the body.

For Example: If you'd like to update all contacts who have a specific ReferanceAccountId and EmailAddress, you would do so via:

[PATCH] contactLists/{contactListId}/registerDevice + "?match=ReferanceAccountId,Email&ReferanceAccountId=123456&Email=pgannon@customerminds.com"

[PUT] contactLists/{contactListId}/registerDevice + "?match=ReferanceAccountId,Email"
Body: {
  values: {
    "ReferanceAccountId":123456,
    "Email": "pgannon@customerminds.com"
    "Mobile": "353871234567" // Value to be updated
  }
}

Please refer to the given ContactList's Schema/Fields as a list of valid values.

Body Parameters

RegisterContactDeviceRequest
NameDescriptionTypeAdditional information
ContactDTO

Contact

None.

DeviceType

integer

None.

DeviceId

string

None.

OldDeviceId

string

None.

Formats

application/json, text/json

Sample:
{
  "ContactDTO": {
    "ValidationWarnings": [
      "sample string 1",
      "sample string 2"
    ],
    "EncContactId": "sample string 2",
    "ListId": 3,
    "Values": {
      "sample string 1": {},
      "sample string 3": {}
    }
  },
  "DeviceType": 1,
  "DeviceId": "sample string 2",
  "OldDeviceId": "sample string 3"
}

application/csp-report

Sample:
{"ContactDTO":{"ValidationWarnings":["sample string 1","sample string 2"],"EncContactId":"sample string 2","ListId":3,"Values":{"sample string 1":{},"sample string 3":{}}},"DeviceType":1,"DeviceId":"sample string 2","OldDeviceId":"sample string 3"}

application/xml, text/xml

Sample:
<ContactListsController.RegisterContactDeviceRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/W50API.Controllers">
  <ContactDTO xmlns:d2p1="http://schemas.datacontract.org/2004/07/W50API.Models.DTO">
    <EncContactId xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">sample string 2</EncContactId>
    <Id xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">1</Id>
    <ListId xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">3</ListId>
    <ValidationWarnings xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">
      <d3p1:string>sample string 1</d3p1:string>
      <d3p1:string>sample string 2</d3p1:string>
    </ValidationWarnings>
    <Values xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">
      <d3p1:KeyValueOfstringanyType>
        <d3p1:Key>sample string 1</d3p1:Key>
        <d3p1:Value />
      </d3p1:KeyValueOfstringanyType>
      <d3p1:KeyValueOfstringanyType>
        <d3p1:Key>sample string 3</d3p1:Key>
        <d3p1:Value />
      </d3p1:KeyValueOfstringanyType>
    </Values>
  </ContactDTO>
  <DeviceId>sample string 2</DeviceId>
  <DeviceType>1</DeviceType>
  <OldDeviceId>sample string 3</OldDeviceId>
</ContactListsController.RegisterContactDeviceRequest>

Response Information

Description

Successful Response - OK (200):

The Contact(s) was/were created/updated, with an additional Encrypted Contact Id if contact inserted

Response Content : Contact

NameDescriptionTypeAdditional information
ValidationWarnings

Collection of string

None.

EncContactId

string

None.

ListId

integer

None.

Values

Dictionary of string [key] and Object [value]

None.


Response Codes:

  • 200 - OK
    • The contact was updated successfully.
  • 401 - Unauthorized
    • The Request has been denied as it lacks valid Authentication credentials.
  • 403 - Forbidden
    • The user does not have the relevant permissions to perform this action.
  • 404 - NotFound
    • The specified Contactlist was not found - could not create contact.
  • 417 - ExpectationFailed
    • The Request has failed due to invalid parameters.
  • 500 - InternalServerError
    • An error occurred while processing this request.

Formats

application/json, text/json

Sample:
{
  "ValidationWarnings": [
    "sample string 1",
    "sample string 2"
  ],
  "EncContactId": "sample string 2",
  "ListId": 3,
  "Values": {
    "sample string 1": {},
    "sample string 3": {}
  }
}

application/csp-report

Sample:
{"ValidationWarnings":["sample string 1","sample string 2"],"EncContactId":"sample string 2","ListId":3,"Values":{"sample string 1":{},"sample string 3":{}}}

application/xml, text/xml

Sample:
<Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/W50API.Models.DTO">
  <EncContactId xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">sample string 2</EncContactId>
  <Id xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">1</Id>
  <ListId xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">3</ListId>
  <ValidationWarnings xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </ValidationWarnings>
  <Values xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/W50Common.Model.DTO">
    <d2p1:KeyValueOfstringanyType>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value />
    </d2p1:KeyValueOfstringanyType>
    <d2p1:KeyValueOfstringanyType>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value />
    </d2p1:KeyValueOfstringanyType>
  </Values>
</Contact>