Fetch Analytics for a Contact
This API retrieves the contact’s analytics based on the Ids passed. Contact’s analytics includes all information about a call. This is a streaming API.
Endpoint
Method: GET
URL: analytics/contacts/{id}
Header Parameter
Authorization Bearer <Token>
Query Parameter
Parameter Name | Mandatory/ Optional | Type | Description |
---|---|---|---|
| Mandatory | string | Id of the contact for which analytics needs to be fetched |
Example Request
curl -H “Authorization: Bearer 911999706310ffbcb32981863e23ce72d5e60d7b” -XGET http://host:port/analytics/contacts/{id}
Example Response
{ "_id": "5f10785fa2803bbd2c70f170", "contact-metadata": { "id": "59589", "contact-id": "fd9ab785-d0c0-4471-8e2e-4c4b334dd3f7", "tenant-id": "1", "org-id": "2", "cat-id": "13", "type": "voice", "cust-crm-id": "26799", "cust-id": "205", "agent-crm-id": "26799", "agent-id": "353" }, "contact-attributes": { "dur": 499382, "dur-slab-id": "0", "holds": 3, "hold-dur": 50614, "hold-pct": 0.005927214, "cust-speech-overlap": 2068, "cust-speech-overlaps": 1, "agent-long-talk": 220890, "agent-long-talks": 12 }, "business-rule-results": [ { "id": "176", "val": 0 }, { "id": "1120", "val": 0 }, { "id": "2005", "val": 1 }, { "id": "2006", "val": 0 } ], "score-results": [ { "id": "25", "val": 0, "slab-id": "105", "components": [ { "id": "203", "val": 0 } ] }, { "id": "186", "val": 40, "slab-id": "578", "components": [ { "id": "436", "val": 100 }, { "id": "437", "val": 0 } ] } ] }
Response and Error Codes
Code | Response |
---|---|
200 | OK – The request was successful |
401 | {“reason”:”Authentication failed”} |
404 | {“reason”:”not found”} |
422 | {“error”: “Error while decoding response from the database”} |
500 | {“error”: “Internal server error”} |