Tutorial: Using Optional Filters

You can include optional filters to retrieve statistics that consider a specific subset of tenant objects. For example, you can return statistics for a specific queue, direction, resource, or flow ID.

For this tutorial, we expand on the request we used in Tutorial: Building a Basic Reporting API Request. In that tutorial, we built a request for the interactions-in-conversation-count statistic, which reports on all interactions in your tenant. The basic request looked like this:

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'

Now we want the statistic to only report on inbound interactions. To achieve this, we need to add a query parameter.

  1. To see what optional filters are available for the statistic, perform the following request:

    curl GET https://api.cxengage.net/v1/tenants/<tenantId>/realtime-statistics/available -u '<yourUsername>:<yourPassword>'

  2. Locate the interactions-in-conversation-count statistic in the response. Note that the response lists the following optional filters as such:
     "optionalFilters": [
                        ]
  3. Append the basic request with ?direction=inbound.

    The request should now looks like this:

    curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/realtime-statistics/interactions-in-conversation-count?direction=inbound
    -u 'sbright@hercompany.com:Password#1234'


You might also be interested in: