Example: Get a Count Statistic

This example demonstrates how to use a GET request to retrieve a count-based statistic.

For this example, we use the interactions-in-conversation-count statistic.

Request

Sample Request

The request below returns the number of interactions that are currently in conversation:

curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/realtime-statistics/interactions-in-conversation-count          

Request Parameters

The table below lists the parameters you must include in a request:

Parameter Required? Type Description

tenantId

Yes UUID The tenant's unique identifier.

Response

Sample Response

The request returns JSON structured like the example below:

{
    "results": {
        "count": 52,
        "unit": "count",
        "queryWindow": {
            "start": "2017-07-11T03:00:00Z",
            "end": "2017-07-12T02:59:59Z"
        }
    },
    "queryTime": 20
}
          
                

Response Parameters

The response includes the following parameters:

Parameter Type Description
count string The number that represents the occurrence, instance, or item that the statistic is counting.
unit string

How the value is measured. In this case, count.

queryWindow object

A JSON object containing the following parameters:

  • start – The start of the time interval, in UTC format, over which the statistics were computed.
  • end – The end of the time interval, in UTC format, over which the statistics were computed.
queryTime string

The length of time, in milliseconds, that it took for the API to respond to the call.