Get Items #
Gets any directory items matching the supplied filter.
GET /v1.0/contactdirectories/{DIRECTORY_ID}/items?filter={FILTER}&fields={FIELDS}
warning
Remember to URL Encode any parameters being passed in the 'filter' parameter.
note
When searching on 'phoneX' fields, the numbers are stored in E.164 format.
Example #
This request will query all items with a phone field containing +44XXXXXXXXXX
tip
Searches are done using a CONTAINS query
Request #
GET <https://api.na.myreports.cloud/api/v1.0/contactdirectories/00000000-0000-0000-0000-000000000000/items?filter%2B44XXXXXXXXXX=&fields=phone1&fields=phone2&fields=phone3&fields=phone4> HTTP/1.1
Authorization: Bearer {TOKEN}
Response #
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: xx
{
"page_size": 1,
"data": [{
"id": "00000000-0000-0000-0000-000000000123",
"fields": {
"title": "Mr",
"fullName": "CRM2",
"companyName": "Company",
"jobTitle": "Job Title",
"phone1": "+44XXXXXXXXXX",
"email": "Email Address",
"field1": "field1",
"field2": "field2",
"crmId": "00000000-0000-0000-0000-000000000001"
}
}
][{
"id": "00000000-0000-0000-0000-000000000123",
"fields": {
"title": "Mr",
"fullName": "CRM2",
"companyName": "Company",
"jobTitle": "Job Title",
"phone1": "+44XXXXXXXXXX",
"email": "Email Address",
"field1": "field1",
"field2": "field2",
"crmId": "00000000-0000-0000-0000-000000000001"
}
}
],
"status": "success",
"timestamp": "2019-01-01T10:00:00.2890319Z"
}
Errors #
Unauthorized #
When the token is not provided, invalid or expired
HTTP/1.1 401 Unauthorized
Bad Request #
When the provided filter or fields are not in the correct format
HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
"error": 400,
"message": "The value '<directory id>' is not valid.",
"status": "error",
"timestamp": "2020-02-06T12:45:27.5903465Z"
}
Not Found #
When there are no directory items found to match the supplied filter.
HTTP/1.1 404 Not Found
Date: Thu, 06 Feb 2020 12:46:58 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 95
{
"error": 404,
"message": "Not Found",
"status": "error",
"timestamp": "2020-02-06T12:46:58.7669535Z"
}