Reference for the /stats API
The /stats
API enables you to retrieve daily statistics for folders by specifying a date or date range for which you want to retrieve information. Statistics are returned in JSON format, include call volume and average call duration, and also includes agent information if calls include agent id metadata.
Synopsis
GET /stats/CO_SHORT
/ORG_SHORT
?token=TOKEN
&OPTIONS
... GET /stats/CO_SHORT
/ORG_SHORT
/FOLDERNAME
?token=TOKEN
&OPTIONS
...
Description
Variables used in the URL of a call to the /stats
API are the following:
- CO_SHORT
The short name of the company whose statistics you would like to retrieve
- ORG_SHORT
The short name of the organization that you are interested in. Finding that information is shown in /transcribe API Reference.
- FOLDERNAME
The name of the V‑Spark Folder whose statistics you would like to retrieve. If you do not specify the name of a folder, matching statistics for all folders under the specified
ORG_SHORT
will be returned.- TOKEN
The V‑Spark authorization token that you are using to establish permission to retrieve information. You can either use the root token for the target V‑Spark installation (located in the file /opt/voci/state/vspark/apitoken) or the authorization token for the company under which the specified
ORG_SHORT
is located. Locating a company's authorization token is shown in V‑Spark API Permission Requirements.
Options
The following options can be passed as parameters to calls to the /stats
API:
- daterange=START-END
Enables you to specify a date range for daily stats. The
START
andEND
values are both expressed asYYYYMMDD
values, where the year (YYYY
) month (MM
) and day (DD
) values are required. Date ranges are always assumed to be positive (whereSTART
is less thanEND
). No verification is done to ensure that this is correct. Invalid date ranges will simply return no values. IfSTART
is not specified, the default value is today's date. IfEND
is not specified, only the start date's stats are returned. If this option is not specified, today's date is used.Important
No information is returned for dates in the specified range that do NOT contain any calls.
Content Types
GET method returns JSON-formatted data with the "text/html" MIME type
Errors will be returned with the "text/html" MIME type