The SalesTarget REST API

This is the documentation for the SalesTarget API. Read the contents of this page carefully. We make changes to the APIs from time to time. For more information, see API Changes. Endpoints are documented with the HTTP method for the request and a partial resource identifier.

Example:
GET /external-api/address/get-all

Prepend your SalesTarget URL to the resource identifier to get the full endpoint URL:

https://backoffice.callmonkey.com/external-api/address/get-all

Security and Authentication

This is an SSL-only API, regardless of how your account is configured.

You can authorize against the API using an API Key. The API Key is managed under "My account" in your SalesTarget environment.

Add the following authentication variable with every request header:

apiKey: {API Key}

Example

curl -H “apiKey: {API Key}” https://backoffice.callmonkey.com/external-api/address/get-all

Request Format

The SalesTarget API is a JSON-only API. You must supply a Content-Type: application/json header in all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to resolve.

Response Format

SalesTarget responds to successful requests with HTTP status codes in the 200 range. When you create a resource, depending on the resource SalesTarget renders the resulting created resource ID in the response body.

SalesTarget responds to unsuccessful requests with HTTP status codes in the 400 range. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error:
{
    "timestamp": 1551780427480,
    "status": 400,
    "error": "Bad Request",
    "exception": "org.springframework.web.bind.MissingServletRequestParameterException",
    "message": "Required int parameter 'page' is not present",
    "path": "//address/get-all"
}
 
If you experience responses with status codes in the 500 range, SalesTarget may be experiencing internal issues or undergoing scheduled maintenance, during which we send a 503 Service Unavailable status code. When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@salestarget.io

Filtering

With your request you can add several filter parameters in the request URL.
created parameter - The created date of the address.
updated parameter - The last updated date of the address.
follow-up parameter - The follow-up date of the address.
assignee parameter - The user id whom the address is assigned to.
operator parameter - The user id who worked on address.
field parameter - The data will be filtered based on the provided fields FieldID and their values.
sortBy parameter - The field and direction to sort the data by.

If this is a normal Array, an AND-search will be done on the given fields.

Use case: Search for all entries in 'OROrganisation' that have 'BV' from page 1 with max 50 records, order by 'created' descending:
field=OROrganisation|BV&page=1&size=50&sortBy=created|DESC
Use case: Search for all entries in 'OROrganisation' that have 'BV' from page 1 with max 50 records, order by 'updated' ascending:
field=OROrganisation|BV&page=1&size=50&sortBy=updated|ASC
Use case: Search for all entries in 'OROrganisation' that have 'BV' AND entries in 'CPEmail1' that have 'gmail.com' from page 1 with max 50 records, order by 'follow-up' descending:
field=OROrganisation|BV;CPEmail1|gmail.com&page=1&size=50&sortBy=follow-up|DESC
Currently filtering only works on a couple of GET /address/ endpoints, see our documentation to which this functionality is included.

Return limit and pagination

By default, most GET requests return a maximum of 100 records. You can change the number of records on a per-request basis by passing a limit parameter in the request URL parameters. Example: size=100. When the results exceed the limit, you can iterate through the records by incrementing the page parameter.

Use case: Search for all entries in 'OROrganisation' that have 'BV' from page 1 with max 50 records, order by 'created' descending:
field=OROrganisation|BV&page=1&size=50&sortBy=created|DESC

Sorting your results

You can pass a sort parameter in the request URL. This parameter should contain a list of fields where to sort on. By default, the sort order is ascending.

Use case: Search for all entries in 'OROrganisation' that have 'BV' OR entries in 'CPEmail1' that have 'gmail.com', max 50 records from page 1, order by created ascending:
field=OROrganisation|BV;CPEmail1|gmail.com&size=50&page=1&sortBy=created|ASC
Use case: Search for all entries in 'OROrganisation' that have 'BV' OR entries in 'CPEmail1' that have 'gmail.com', max 50 records from page 1, order by created descending:
field=OROrganisation|BV;CPEmail1|gmail.com&size=50&page=1&sortBy=created|DESC

Questions and support

If you have any questions regarding the use of the API, please contact us at support@salestarget.io