Reports API
Reports API allows you to access and extract all the Reports data available in LiveChat.
This document describes the LiveChat Reports API v3.2, which is a legacy version. For production-ready applications, it's best to use to the current stable version. Read more about versioning...
API responses will contain one of two headers related to the API lifecycle: Legacy
or Deprecation
. These headers specify when the associated stage ends (in the YYYY-MM-DD
format).
You can authorize your calls to the Reports API using one of the following methods:
Use the Postman Collection to try out the requests from the Reports API v3.2.
The API endpoint |
---|
https://api.livechatinc.com/v3.2/reports/<resource>/<action> |
Header | Value | Required | Notes |
---|
Authorization | Bearer <token> | Yes | Your access token |
X-API-Version | 3.2 | No | You can specify the API version in the URL instead. |
Response Header | Value | Notes |
---|
Legacy | YYYY-MM-DD | The date when the legacy stage ends. |
Deprecation | YYYY-MM-DD | The date when the deprecated stage ends. |
Shows the average chatting duration of agents within a license.
| |
---|
Method URL | https://api.livechatinc.com/v3.2/reports/chats/agents_chatting_duration |
HTTP method | GET |
Required scopes | reports_read |
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format |
from | yes | Date in the RFC3339 format |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license |
groups | no | Group IDs separated by a comma |
tags | no | Names of tags separated by a comma |
customer_client_ids | no | Client IDs separated by a comma |
distribution | no | Possible values: hour , day-hours , day , month ; defaults to day |
tagged | no | Possible values: true , 1 , false , 0 |
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains distribution objects, for example, day . |
records.day.count | The total number of chats agents had that day . |
records.day.seconds | The average chat duration agents had that day . |
Shows the distribution of tags for chats.
| |
---|
Method URL | https://api.livechatinc.com/v3.2/reports/chats/tags |
HTTP method | GET |
Required scopes | reports_read |
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format |
from | yes | Date in the RFC3339 format |
distribution | yes | Possible values: hour , day-hours , day , month , year |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license. |
groups | no | Group IDs separated by a comma |
names | no | The names of tags separated by a comma; when tags=:without: , you will get the total number of chats without tags, when tags=:with: you will get the total number of chats with tags. |
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains the distribution objects, for example, day . |
records.day.<tag> | The total number of chats tagged with <tag> . |
If you found a bug or a typo, you can create an issue on GitHub. In case of any questions or feedback, don't hesitate to contact us at developers@livechat.com