Reports API
Introduction
Reports API allows you to access and extract all the Reports data available in LiveChat.
Versioning
This document describes the LiveChat Reports API v3.3, which is a legacy version. For production-ready applications, it's best to use to the current stable version. Read more about versioning...
Lifecycle headers
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).
Authorization
You can authorize your calls to the Reports API using one of the following methods:
Postman collection
You can find all the requests from the Reports API v3.3 in Postman. In our collection, we use environment variables for the API version and the access token. Importing the collection from the link below downloads the LiveChat Web API environment as well. Remember to replace sample tokens with your own.
Methods
The API endpoint |
---|
https://api.livechatinc.com/v3.3/reports/<resource>/<action> |
Header | Value | Required | Notes |
---|
Authorization | Bearer <token> | Yes | Your access token |
X-API-Version | 3.3 | No | You can specify the API version in the URL instead. |
Available methods
Chats
Agents Chatting Duration
Shows the average chatting duration of agents within a license.
Specifics
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/agents_chatting_duration |
HTTP method | GET |
Required scopes | reports_read |
Request
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
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 |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). By default, the timezone is taken from the request. If it isn't provided, then it's taken from the agent's timezone. When it's impossible to load the agent's timezone, from is parsed to get it. |
tagged | no | Possible values: true , 1 , false , 0 |
Response
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 . |
Tags
Shows the distribution of tags for chats.
Specifics
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/tags |
HTTP method | GET |
Required scopes | reports_read |
Request
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
distribution | yes | Possible values: hour , day-hours , day , month , year |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). By default, the timezone is taken from the request. If it isn't provided, then it's taken from the agent's timezone. When it's impossible to load the agent's timezone,from is parsed to get it. |
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. |
Response
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> . |
Total Chats
Shows how many chats occurred during the specified period.
Specifics
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/total_chats |
HTTP method | GET |
Required scopes | reports_read |
Request
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
distribution | no | Possible values: hour , day-hours , day , month ; defaults to day |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). By default, the timezone is taken from the request. If it isn't provided, then it's taken from the agent's timezone. When it's impossible to load the agent's timezone, from is parsed to get it. |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license. |
agent_assigned | no | Possible values: true , 1 , false , 0 |
groups | no | Group IDs separated by a comma |
customer_client_ids | no | Client IDs separated by a comma |
tags | no | Names of tags separated by a comma |
tagged | no | Possible values: true , 1 , false , 0 |
Response
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains the distribution objects, for example, day . |
records.day.total | The total number of chats that day . |
records.day.continuous | The number of continuous chats that day . |
Contact us
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@text.com