Skip to content

upsertContacts ​

Inserts OR updates contacts from an external CRM system.

Request ​

http
POST /rest/company/contact/upsert

Headers ​

HeaderRequiredDescription
x-nextinteract-authtokenYesAuth token returned from loginUser

Parameters ​

An array of ContactJSON objects i.e.

json
[
  {
    "contactId": null,
    "countryCode": "AU",
    "otherCountryCode": null,
    "externalId": "CRMID-123",
    "contactType": null,
    "title": null,
    "firstname": "TestContact",
    "lastname": "McMullen",
    "mobile": null,
    "phone": null,
    "otherPhone": null,
    "department": null,
    "contactProfession": "Doctor",
    "contactSpecialty": "Oncologist",
    "contactCategory": "Sat Nov 15 13:34:00 EST 2014",
    "email1": "aaron@interact.technology",
    "email2": null,
    "company": null,
    "workAddress1": "100 Test Street",
    "workAddress2": "North Sydney",
    "workAddress3": null,
    "city": "Sydney",
    "state": null,
    "postCode": "2061",
    "ownedBy": null,
    "notes": null,
    "facebookId": null,
    "dateOfBirth": null,
    "webPage": null,
    "otherAddress1": null,
    "otherAddress2": null,
    "otherAddress3": null,
    "otherCity": null,
    "otherState": null,
    "otherPostcode": null,
    "faxNumber": null,
    "twitterId": null,
    "contactCreated": null,
    "contactCreatedBy": null,
    "contactModified": 1416018840030,
    "contactModifiedBy": null
  },
  {
    "contactId": null,
    "countryCode": "AU",
    "otherCountryCode": null,
    "externalId": "CRMID-456",
    "contactType": null,
    "title": null,
    "firstname": "LeoTestContact",
    "lastname": "Chen",
    "mobile": null,
    "phone": null,
    "otherPhone": null,
    "department": null,
    "contactProfession": "Doctor",
    "contactSpecialty": "Cardiologist",
    "contactCategory": "Sat Nov 15 13:34:00 EST 2014",
    "email1": "leo@interact.technology",
    "email2": null,
    "company": null,
    "workAddress1": "100 Test Street",
    "workAddress2": "North Sydney",
    "workAddress3": null,
    "city": "Sydney",
    "state": null,
    "postCode": "2061",
    "ownedBy": null,
    "notes": null,
    "facebookId": null,
    "dateOfBirth": null,
    "webPage": null,
    "otherAddress1": null,
    "otherAddress2": null,
    "otherAddress3": null,
    "otherCity": null,
    "otherState": null,
    "otherPostcode": null,
    "faxNumber": null,
    "twitterId": null,
    "contactCreated": null,
    "contactCreatedBy": null,
    "contactModified": 1416018840030,
    "contactModifiedBy": null
  }
]

Response ​

200 OK ​

Returns the number of records successfully saved to SAM.

json
[
  {
    "recordId": "CRMID-123",
    "rowsAffected": 1
  },
  {
    "recordId": "CRMID-456",
    "rowsAffected": 1
  }
]

Errors ​

ExceptionDescription
WSUserServiceUnavailableExceptionSee Error Definitions
WSCompanyServiceUnavailableExceptionSee Error Definitions
WSInvalidAuthTokenExceptionSee Error Definitions
WSInvalidParameterExceptionSee Error Definitions
WSInsufficientPermissionsExceptionSee Error Definitions
WSCompanyServiceExceptionSee Error Definitions
WSCacheServiceExceptionSee Error Definitions