• Release Notes
  • User
  • Admin
  • Developers
  • Integrations

›REST API Examples

General

  • Co-Browsing
  • Universal Embedded Co-Browsing
  • Chat
  • Videocalling with Queue
  • Generate API Token

External

  • Salesforce
  • Outlook
  • Freshdesk
  • Microsoft Teams
  • ZealiD
  • Individual Platform

Data

  • Audit Logs

Use Cases

  • CoBrowsing - Example
  • SessionRecording - Optin/Optout button
  • UserTagging & Login Example
  • UserTagging & Screensharing Example
  • Mobile user tagging & LiveView
  • WebChat API - Example
  • ActionRules Matched API - Example

REST API Examples

  • Agent Times
  • Rule matches
  • Appointments
  • Universal Co-Browsing

REST Example - Agent Times

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"
}
[
{
"userId": "agent1@example.com",
"timeRanges": [
{
"start": "2020-10-31T23:00:00.794Z",
"end": "2020-10-31T23:03:25.794Z"
},
{
"start": "2020-11-01T23:00:00.794Z",
"end": "2020-11-01T23:00:25.794Z"
},
{
"start": "2020-10-29T23:00:00.794Z",
"end": "2020-10-29T23:03:25.794Z"
}
],
"sumMinutes": 6
},
{
"userId": "agent2@example.com",
"timeRanges": [
{
"start": "2020-10-29T23:00:00.794Z",
"end": "2020-10-29T23:06:50.794Z"
}
],
"sumMinutes": 6
}
]

Aggregation of agent online/loggedin times

This API call returns a 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"
}
}
{
"results": {
"2020/10/30": {
"agent1@example.com": "205",
"agent2@example.com": "411"
},
"2020/11/01": {
"agent1@example.com": "205"
},
"2020/11/02": {
"agent1@example.com": "25"
}
}
}
← ActionRules Matched API - ExampleRule matches →
  • List of agent online/loggedin times
  • Aggregation of agent online/loggedin times
MANUALS
User Manual: Sales Suite
Admin Manual: Sales Suite
User Manual: Support Suite
Admin Manual: Support Suite
DEVELOPERS
Integrations
REST API
SDK API
LEGAL
Privacy Policy
Terms and Conditions
Imprint
Engage
Copyright © 2024 TeamViewer Austria GmbH