Realtime Data Example

In this example, we'll test the Realtime Data API's functionality. We will go through the setup and query required to get the list of available Realtime metrics, and the setup and query required get the details of a specific Realtime metric.

Common Setup

Create a Service User

Within Chronicall, create a new Service User. This will provide us with an authentication key.

  • Create a new user in User Management > User Accounts.
  • Click the User drop-down menu and select .
  • Enter a name in the Name field and select the "Service User" option at the bottom.
  • Save your changes.

Once completed, you will find the authentication key within API Enablement > Service Users.

403

Configure a Realtime Data Access Report

Within Chronicall, we will configure a Realtime metric to be used via the Realtime Data Access API. In this example we will be using the "Do Not Disturb Count" metric.

  • Start by going to API Enablement > Realtime Metric Access.
  • Give your metric a name; we will use MyMetric.
  • Select a Metric Category.
  • Select a Realtime Metric.
  • In the Service Account section, select the service account you created earlier.
  • Note that a custom Metric ID string was generated. This will be used later.
  • Press OK.
615

Common Postman Setup

Download and install the Postman application at the Postman Site.

Launch Postman.

Create a new Request for each API request.

  • We'll name the Request "Realtime Demonstration".
  • You may also need to create a "Collection." We'll call ours "Sample Collection".

In your new request configure the authorization.

  • Within Postman, click the Authorization tab.
  • Set the Type to Bearer Token.
  • Copy the Service User Authentication Key created earlier, which is found in API Enablement > Service Users, and paste it here.
1106

Configure the Metric List Query

After following the "Common Setup" above, we will update the URL query within Postman.

  • Change the API type to "GET".
  • Replace the request URL with http://localhost:9080/rest/api/v1/realtime/metrics
426

We are now ready to submit our query. Click on Send within Postman. You will see the resulting response below in the Response field.

1592

Configure the Metric Detail Query

After following the "Common Setup" above, we will update the URL query within Postman.

  • Change the API type to "GET".
  • replace the request URL with http://localhost:9080/rest/api/v1/realtime/metrics/values?id={ids…}
545

It's important to note that IDs can be one metric ID or a comma separated list of metric IDs. The metric ID can be found when you are setting up your new Realtime metric or by going back to API Enablement > Realtime Metric Access within Chronicall.

We are now ready to submit our query. Click on Send within Postman. You will see the resulting response below in the Response field.

1592