Companies
Company endpoints allow for querying or updating of Company data within CMap
Get Company
HTTP GET v2/Companies/5
Returns the company with the matching id (if that company exists)
Response
{
"id": 23423,
"name": "Smith Industries",
"telephone": "01625 521 000",
"website": "http://www.smithindustries.com",
"fax": "01625 521 001",
"notes": "Some information about this company",
"address": "1 Hope Street, Manchester, M22 4TG",
"externalRef": "ABCD1234",
"defaultAddressId": 123123,
"ownerId": null,
"linkedIn": "",
"parentAccountId": null,
"twitter": "",
"vatNumber": "123",
"paymentDays": null,
"addresses": [
{
"addressID": 123123,
"description": "Main Address",
"address1": "1 Hope Street",
"address2": "",
"address3": "",
"townCity": "Manchester",
"countyState": "",
"postcode": "M22 4TG",
"countryID": 1,
"country": {
"Name": "United Kingdom",
"Code": "GB"
},
"invoiceAddress": true
}
],
"customFields": {
"A Custom": "Field",
"Another": "Value"
}
}
Get Companies
HTTP GET v1/Companies
Returns all companies belonging to the client
Response
[
{
"id": "876876",
"name": "Smith Industries"
}
]
Get Companies By Query
GET v1/Companies?q=[query]
Returns all companies that match the search query
Response
[
{
"id": "876876",
"name": "Smith Industries"
},
{
"id": "3345345",
"name": "Smith Corp."
}
]
Get Company Addresses
GET v2/Companies/5/Addresses
Returns all addresses associated with a company
Response
[
{
"addressID": 123123,
"description": "Main Address",
"address1": "1 Hope Street",
"address2": "",
"address3": "",
"townCity": "Manchester",
"countyState": "",
"postcode": "M22 4TG",
"countryID": 1,
"country": {
"Name": "United Kingdom",
"Code": "GB"
},
"invoiceAddress": true
}
]
Create Company
HTTP POST v1/Companies/
Creates the Company and returns the Id
Request
{
"name": "Smith Industries",
"telephone": "01625 521 000",
"website": "http://www.smithindustries.com",
"fax": "01625 521 001",
"paymentDays": "30",
"notes": "Some information about this company",
"addresses": [
{
"description": "HQ",
"address1": "1 Hope Street",
"address2": "",
"address3": "",
"townCity": "Manchester",
"countyState": "Greater Manchester",
"postcode": "M22 4TG"
}
],
"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
{
"companyId": 12345
}
Update Company
HTTP PUT v1/Companies/
Updates the Company and returns the Id
Request
{
"name": "Smith Industries",
"telephone": "01625 521 000",
"website": "http://www.smithindustries.com",
"fax": "01625 521 001",
"paymentDays": "30",
"notes": "Some information about this company",
"addresses": [
{
"description": "HQ",
"address1": "1 Hope Street",
"address2": "",
"address3": "",
"townCity": "Manchester",
"countyState": "Greater Manchester",
"postcode": "M22 4TG"
}
],
"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
{
"companyId": 12345
}