Arlo

REST Auth API: ContactMergeRequests

ContactMergeRequest resources describe details of completed merges between two Contact resources. Merge requests are executed by administrators to resolve duplicate resources by merging details from a source contact into a target destination contact. At the end of the operation, the source contact is effectively deleted.

ContactMergeRequests are important for integrators as they provide an audit trail for tracking contacts that are no longer available because they have been merged with another record. Arlo recommends that any integration with contacts also uses this resource to track changes to contacts that will no longer be available in the API.

After a merge is completed, HTTP GET requests to the URI of the source (deleted) contact will return a HTTP 308 Permanent Redirect status with headers referring to the merged contact URI and the original ContactMergeRequest.

Requests are described by details about the source and destination contacts along with the date of the request.

This resource supports retrieval of individual contact merge request instances, collections of contact merge requests, and creating new contact merge requests.

ContactMergeRequests instance resource

Resource URI

/api/2012-02-01/auth/resources/contactmergerequests/{RequestID}/

General structure

<ContactMergeRequest>
  <RequestID>3176d891-25e8-4741-9a37-08fa0dd6ad20</RequestID>
  <SourceContactInfo>
    <ContactID>13265</ContactID>
    <UniqueIdentifier>dbeeb7b2-12de-4f26-9b1c-48454a3bb69d</UniqueIdentifier>
  </SourceContactInfo>
  <DestinationContactInfo>
    <ContactID>13390</ContactID>
    <UniqueIdentifier>41326d7d-2edd-4eb5-b176-2f408693b8fc</UniqueIdentifier>
  </DestinationContactInfo>
  <CreatedDateTime>2015-05-28T17:51:51.941+12:00</CreatedDateTime>
  <Link rel="self" type="application/xml" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/3176d891-25e8-4741-9a37-08fa0dd6ad20/" />
</ContactMergeRequest>

Resource properties

Property Description
RequestID A GUID value that uniquely identifies this resource across any platform. This value is read-only.
SourceContactInfo Structure containing information about the source contact for the merge. This refers to the contact that was deleted at the end of the operation.
Structure fields
  • ContactID: An integer value identifying the contact.
  • UniqueIdentifier: GUID value identifying the contact.
DestinationContactInfo Structure containing information about the destination contact for the merge. This refers to the contact that was the final result of the merge between the two.
Structure fields
  • ContactID: An integer value identifying the contact.
  • UniqueIdentifier: GUID value identifying the contact.
CreatedDateTime A DateTime value indicating when this resource was created.

HTTP GET

Returns a representation of a ContactMergeRequest, including the properties above.

Example

GET /api/2012-02-01/auth/resources/contactmergerequests/3176d891-25e8-4741-9a37-08fa0dd6ad20/

<ContactMergeRequest>
  <RequestID>3176d891-25e8-4741-9a37-08fa0dd6ad20</RequestID>
  <SourceContactInfo>
    <ContactID>13265</ContactID>
    <UniqueIdentifier>dbeeb7b2-12de-4f26-9b1c-48454a3bb69d</UniqueIdentifier>
  </SourceContactInfo>
  <DestinationContactInfo>
    <ContactID>13390</ContactID>
    <UniqueIdentifier>41326d7d-2edd-4eb5-b176-2f408693b8fc</UniqueIdentifier>
  </DestinationContactInfo>
  <CreatedDateTime>2015-05-28T17:51:51.941+12:00</CreatedDateTime>
  <Link rel="self" type="application/xml" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/3176d891-25e8-4741-9a37-08fa0dd6ad20/" />
</ContactMergeRequest>

HTTP POST

Not supported.

HTTP PUT

Not supported.

HTTP DELETE

Not supported.

ContactMergeRequests collection resource

The ContactMergeRequests collection resource represents the set of ContactMergeRequests resources on the platform.

Resource URI

/api/2012-02-01/auth/resources/contactmergerequests/

HTTP GET

Returns a representation of the collection as a set of Link elements which can be followed to access individual ContactMergeRequests resources, or link expansion can be used via the expand query parameter to inline the entities with the HTTP GET response. See querying collections for general information on handling resource collections.

Optional parameters
Parameter Description
expand Expression referencing Link elements to expand when generating the response. See link expansion.
filter A filter expression to apply to the collection. See collection filters. The following properties (and link titles) may be used in filter expressions:
  • CreatedDateTime
skip Returns a subset of records from the collection, starting at index N+1 specified by this parameter. The skip and top parameters are generally used for collection paging.
top Returns a subset of records from the collection, starting at index 0 or index skip, and returns the first N records. The skip and top parameters are generally used for collection paging.
Example 1

Retrieve a collection of ContactMergeRequest links with the default parameters, and no link expansion.

GET /api/2012-02-01/auth/resources/contactmergerequests/

<ContactMergeRequests>
  <Link rel="http://schemas.arlo.co/api/2012/02/auth/ContactMergeRequest"" type="application/xml" title="ContactMergeRequest" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/5fcad509-3395-4fa5-8452-bfc69145a0b1/"/>
  <Link rel="http://schemas.arlo.co/api/2012/02/auth/ContactMergeRequest"" type="application/xml" title="ContactMergeRequest" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/549ffc79-8670-4bd4-9427-403cd4c7a7ef/"/>
  <Link rel="http://schemas.arlo.co/api/2012/02/auth/ContactMergeRequest"" type="application/xml" title="ContactMergeRequest" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/3bba2d32-3ae6-4324-be99-f815faab58c3/"/>
  <Link rel="http://schemas.arlo.co/api/2012/02/auth/ContactMergeRequest"" type="application/xml" title="ContactMergeRequest" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/b645a9d4-f47b-4da7-ab31-db1bf63b8b93/"/>
  ...
  <Link rel="self" type="application/xml" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contactmergerequests/"/>
</Contacts>

HTTP POST

Performs a merge of two Contacts by merging into the DestinationContact and then deleting the SourceContact.

The submitted ContactMergeRequest representation must be complete but excluding properties:

  • RequestID
  • CreatedDateTime
  • Link
Response

See HTTP response status codes for a general overview of all possible API status codes. Common response codes for POST operations are listed below.

Status Description
200 Created Resource was successfully created. The body of the response will contain a complete ContactMergeRequest representation.
400 Bad Request HTTP request body contains malformed or invalid parameters.

Possible exception Code and Message:
  • ContactNotFound - Contact with ID {ContactID} and UniqueIdentifier {ContactUniqueIdentifier} cannot be found.
  • SourceAndDestinationContactIdentical - The source and destination contact are the same user.
409 Conflict Resource could not be created because it contains values that conflict with those on the server.

Possible exception Code and Message:
  • ReadonlyContact - A readonly contact cannot be merged.
  • SourceContactIsPlatformAdmin - The source contact is a platform administrator.
  • SourceContactIsAdmin - The source contact is an administrator.
  • SourceContactIsLoggedInUser - The source contact is the logged in user.
  • DuplicateRegistrations - The merge would result in duplicate registrations.
  • ApplicationOrRegistrationConflict - The merge would result in registration or application conflicts.
Example

POST /api/2012-02-01/auth/resources/contactmergerequests/

<ContactMergeRequest>
  <SourceContactInfo>
    <ContactID>13265</ContactID>
    <UniqueIdentifier>dbeeb7b2-12de-4f26-9b1c-48454a3bb69d</UniqueIdentifier>
  </SourceContactInfo>
  <DestinationContactInfo>
    <ContactID>13390</ContactID>
    <UniqueIdentifier>41326d7d-2edd-4eb5-b176-2f408693b8fc</UniqueIdentifier>
  </DestinationContactInfo>
</ContactMergeRequest>

HTTP PUT

Not supported.

HTTP DELETE

Not supported.