Sample applications (Insights Stats API)

This section contains links to sample Python applications that use the Insight Stats API.

wfm-agent-states

The wfm-agent-states sample applications show how to query the /wfm/agent-states endpoint of the Insights Stats API and store the results in a local SQL database.

The bulk_load sample is designed to be run once per hour. It fetches the last complete hour’s worth of data from the API and saves it into a local SQL database. The bulk load sample demonstrates a simpler integration which loads steady state data in fewer API calls, but necessarily involves latency of at least one hour.

The real_time sample demonstrates a continuously running integration which polls for updated data every 15 seconds and stores the results in a local SQL database. It is a slightly more complicated sample, and involves more API calls because it will typically receive the same logical records in varying degrees of completeness until they are finalized. This sample is suitable when it is necessary to minimize latency.

Prerequisites

To run the samples, you need the following:

  • a Vonage Contact Center account with client credentials generated for the stats scope
  • Python 3.8+ and Pipenv

You can find the application along with its accompanying documentation in the Github repository here: wfm-agent-states sample applications.