Contacts

Contact endpoints allow for querying or updating of Contact data within CMap


Get Contact

HTTP GET v1/Contacts/5

Returns the contact with the matching id (if that contact exists)

Response

[
  {
    "id": "234234",
    "email": "mike.smith@smithindustries.com",
    "firstname": "Mike",
    "lastname": "Smith",
    "linkedIn": "linkedin profile url",
    "mainContact": "true",
    "mobile": "07533 234 234",
    "notes": "notes about this contact",
    "telephone": "01625 521 000",
    "title": "Mr",
    "twitter": "twitter url",
    "jobTitle": "Software Developer",
    "companyId": "33454",
    "company": "Smith Industries",
    "companyTelephone": "01625 521 000",
    "address": {
      "Address1": "5 Hope Street",
      "Address2": "",
      "Address3": "",
      "TownCity": "Manchester",
      "CountyState": "Greater Manchester",
      "Postcode": "M22 4TG"
    }
  }
]

Get Contacts

HTTP GET v1/Contacts

Returns all contacts belonging to the client

Response

[
  {
    "company": "Smith Industries",
    "id": "876876",
    "name": "Mike Smith"
  }
]

Get Contacts By Company

HTTP GET v1/Contacts?companyId=5

Returns all contacts belonging to the company

Response

[
  {
    "id": "876876",
    "firstName": "Mike",
    "lastName": "Smith",
    "displayName": "Smith, Mike",
    "email": "mike.smith@something.com",
  }
]

Get Active Contacts By Company

HTTP GET v1/Contacts/ActiveContactsForCompany?companyId=5

Returns all active contacts belonging to the company

Response

[
  {
    "id": "876876",
    "firstName": "Mike",
    "lastName": "Smith",
    "displayName": "Smith, Mike",
    "email": "mike.smith@something.com",
  }
]

Get Historic Contacts By Company

HTTP GET v1/Contacts/HistoricContactsForCompany?companyId=5

Returns all historic contacts belonging to the company

Response

[
  {
    "id": "876876",
    "firstName": "Mike",
    "lastName": "Smith",
    "displayName": "Smith, Mike",
    "email": "mike.smith@something.com",
  }
]

Get Contacts By Query

HTTP GET v1/Contacts?q=[query]

Returns all contacts that match the search query

Response

[
  {
    "company": "Smith Industries",
    "id": "876876",
    "name": "Mike Smith",
    "email": "mike.smith@smith.inc",
    "jobTitle": "Manager"
  },
  {
    "company": "Smith Industries",
    "id": "3534",
    "name": "Mike Jones",
    "email": "mike.jones@smith.inc",
    "jobTitle": "Deputy Manager"
  }
]

Get Contacts By Email/Name

HTTP GET v1/Contacts?email=email&name=name

Returns all the contacts that match the email address or name specified

Response

[
  {
    "company": "Smith Industries",
    "id": "876876",
    "name": "Mike Smith",
    "email": "mike.smith@smith.inc",
    "jobTitle": "Manager"
  },
  {
    "company": "Smith Industries",
    "id": "3534",
    "name": "Mike Jones",
    "email": "mike.jones@smith.inc",
    "jobTitle": "Deputy Manager"
  }
]

Create Contact

HTTP POST v1/Contacts

Create a new Contact

Request

{
	"firstName" : "Robert",
	"lastName" : "Smith",
	"companyId" : 12456,
	"jobTitle" : "Managing Director",
	"telephone" : "01625 521 000",
	"mobile" : "07799 876543",
	"email" : "robert.smith@abc.com",
	"addressId" : 324,
	"ownerId" : 454,
	"mainContact" : true,
	"financeContact" : false,
	"notes" : "Some information about this contact",
	"CustomFields":{
		"Text Field":"Some exciting text here",
		"Number Field":4356,
		"Dropdown":"one",
		"Date Field":"2024-01-01",
		"Boolean":"Yes",
		"Dropdown Multi":["Item 1", "Item 2"],
		"User Field":"Jim Murphy",
		"User Multi":["Jim Murphy","Arthur Dent"]
	}
}

Response

{
  "contactId" : 1234
}

Update Contact

HTTP PUT v1/Contacts

Updates a Contact

Request

{
  "contactId": 987897,
  "firstName": "Robert",
  "lastName": "Smith",
  "companyId": 12456,
  "jobTitle": "Managing Director",
  "telephone": "01625 521 000",
  "mobile": "07799 876543",
  "email": "robert.smith@abc.com",
  "addressId": 324,
  "ownerId": 454,
  "mainContact": true,
  "financeContact": false,
  "notes": "Some information about this contact",
  "CustomFields": {
    "Text Field": "Some exciting text here",
    "Number Field": 4356,
    "Dropdown": "one",
    "Date Field": "2024-01-01",
    "Boolean": "Yes",
    "Dropdown Multi": [
      "Item 1",
      "Item 2"
    ],
    "User Field": "Jim Murphy",
    "User Multi": [
      "Jim Murphy",
      "Arthur Dent"
    ]
  }
}

Response

{
  "contactId" : 1234
}

Move Contact

HTTP PUT v1/Contacts/MoveContact

Request

{
  "contactId": 1245,
  "companyId": 12456,
  "addressId": 124567
}

Response

{
  "contactId" : 1234
}

Update Contact Company Status

HTTP PUT v1/Contacts/UpdateContactCompanyStatus

Updates a Contact’s link to a Company to a status of Active or Historic

Request

{
  "ContactAccountId": 1245,
  "ContactAccountStatus": "Active"
}

Response

{
	contactCompanyId = 198198,
	contactId = 987897,
	companyId = 876876,
	jobTitle = "Managing Director",
	addressId = 324,
	isMain = true,
	status = "Active"
}