This page gives an example to fetch agent times from REST API. There are two ways to fetch times of the agent.

  • List
  • Aggregation

List of agent online/loggedin times

This API call returns a list of the online times of the agent. https://developers.chatvisor.com/#operation/getAgentLoggedInTimesUsingPOST

Request

Response

POST https://api.chatvisor.com/rest/v1/report/agent/times/online?access_token=<TOKEN>

BODY:
{
    "grouping": "LAST_7_DAYS"
}

Aggregation of agent online/logged in times

This API call returns an aggregated statistic of the agent times in seconds. https://developers.chatvisor.com/#operation/getUsingPOST

Request

Response

POST https://api.chatvisor.com/rest/v1/report/agent?access_token=<TOKEN>

BODY:
{
  "metrics": [
      {
        "metricName": "ONLINE_TIME", # or LOGGED_IN_TIME
        "groupBy": "AGENT" # optional group by agent
      }
  ],
  "dateFilter": {
    "grouping": "LAST_7_DAYS"
  }
}