Tutorial: Building a Basic Reporting API Request

Before you use the Reporting API to retrieve statistics, let's take a look at how to build a basic API request.

General format of a Reporting API request is:

curl https://api.cxengage.net/v1/tenants/<tenantId>/realtime-statistics/<statistic-type>
-u '<username>:<password>'

Click to expand the following topics to view more information about section of the request:

For this tutorial, we’ll build an API call to retrieve information about the total number of interactions that are currently in a conversation. Here's what you need to do:

  1. Find the API name for the statistic that you want to retrieve. To get this information, choose one of the following options:
    1. Use an API request to Get a List of Available Statistics.
    2. Use the Data Dictionary.

    For this tutorial, interactions-in-conversation-count is the API name for the statistic that counts the total number of interactions that are currently in a conversation.

  2. Build your API request, including your basic authorization credentials. Use of the following syntax:
    curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/realtime-statistics/interactions-in-conversation-count
    -u 'sbright@hercompany.com:Password#1234'

If your request is successful, the request returns a response. For detailed examples of requests and responses, see Examples.

If unsuccessful, the request returns an error message. See Errors and Responses.