Platform
APIs & SDKs
Resources

...

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.2, which is a deprecated 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

Use the Postman Collection to try out the requests from the Reports API v3.2.

Run in Postman

Methods

The API endpoint
https://api.livechatinc.com/v3.2/reports/<resource>/<action>
HeaderValueRequiredNotes
AuthorizationBearer <token>YesYour access token
X-API-Version3.2NoYou can specify the API version in the URL instead.
Response HeaderValueNotes
LegacyYYYY-MM-DDThe date when the legacy stage ends.
DeprecationYYYY-MM-DDThe date when the deprecated stage ends.

Available methods

Chatsagents_chatting_duration tags

Chats

Agents Chatting Duration

Shows the average chatting duration of agents within a license.

Specifics
Method URLhttps://api.livechatinc.com/v3.2/reports/chats/agents_chatting_duration
HTTP methodGET
Required scopesreports_read
Request
Query StringRequiredNotes
toyesDate in the RFC3339 format
fromyesDate in the RFC3339 format
agentsnoAgent emails separated by a comma; if not specified, returns the data for all agents within the license
groupsnoGroup IDs separated by a comma
tagsnoNames of tags separated by a comma
customer_client_idsnoClient IDs separated by a comma
distributionnoPossible values: hour, day-hours, day, month; defaults to day
taggednoPossible values: true, 1, false, 0
Response
FieldNotes
totalThe total number of chats in the specified date range.
recordsContains distribution objects, for example, day.
records.day.countThe total number of chats agents had that day.
records.day.secondsThe average chat duration agents had that day.
REQUEST
Copied!
curl "https://api.livechatinc.com/v3.2/reports/chats/agents_chatting_duration?from=2020-09-01T00:00:00%2B02:00&to=2020-09-14T23:59:59%2B02:00" \
  -H 'Authorization: Bearer <your_access_token>'
Response
Copied!
{
	"name": "agents-chatting-duration-report",
	"total": 79,
	"records": {
		"2020-09-01": {},
		"2020-09-02": {},
		"2020-09-03": {},
		"2020-09-04": {},
		"2020-09-05": {
			"count": 67,
			"seconds": 875
		},
		"2020-09-06": {},
		"2020-09-07": {},
		"2020-09-08": {},
		"2020-09-09": {},
		"2020-09-10": {},
		"2020-09-11": {
			"count": 11,
			"seconds": 1337
		},
		"2020-09-12": {},
		"2020-09-13": {},
		"2020-09-14": {
			"count": 1,
			"seconds": 178
		}
	}
}

Tags

Shows the distribution of tags for chats.

Specifics
Method URLhttps://api.livechatinc.com/v3.2/reports/chats/tags
HTTP methodGET
Required scopesreports_read
Request
Query StringRequiredNotes
toyesDate in the RFC3339 format
fromyesDate in the RFC3339 format
distributionyesPossible values: hour, day-hours, day, month, year
agentsnoAgent emails separated by a comma; if not specified, returns the data for all agents within the license.
groupsnoGroup IDs separated by a comma
namesnoThe 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
FieldNotes
totalThe total number of chats in the specified date range.
recordsContains the distribution objects, for example, day.
records.day.<tag>The total number of chats tagged with <tag>.
REQUEST
Copied!
curl "https://api.livechatinc.com/v3.2/reports/chats/tags?from=2020-09-01T00:00:00%2B02:00&to=2020-09-14T23:59:59%2B02:00&distribution=day" \
  -H 'Authorization: Bearer <your_access_token>'
Response
Copied!
{
	"name": "tags-report",
	"total": 329,
	"records": {
		"2020-09-01": {},
		"2020-09-02": {},
		"2020-09-03": {},
		"2020-09-04": {},
		"2020-09-05": {
			"spam": 21,
			"support": 12
		},
		"2020-09-06": {},
		"2020-09-07": {},
		"2020-09-08": {},
		"2020-09-09": {},
		"2020-09-10": {},
		"2020-09-11": {
			"spam": 13,
			"support": 7
		},
		"2020-09-12": {},
		"2020-09-13": {},
		"2020-09-14": {
			"spam": 98,
			"support": 178
		}
	}
}

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

...

Join the community
Get in direct contact with us through Discord.
Follow us
Follow our insightful tweets and interact with our content.
Contribute
See something that's wrong or unclear? Submit a pull request.
Contact us
Want to share feedback? Reach us at: developers@text.com