LiveChat API
Offline messages
Get offline messages list
GET https://api.livechatinc.com/offline_messages
Returns messages left by visitors when the chat is offline.
Optional parameters:
date_from–YYYY-MM-DD. Defaults to (today – 6 days). Specifies the left date range of the returned data.date_to–YYYY-MM-DD. Defaults to today. Specifies the right date range of the returned data.skill– ID of the skill. Not set by default. Returns the results for the given skill.query– Text to search for. Not set by default. Returns the results that contain given word or phrase.
Example result:
{
"offline_messages": [
{
"id": "M144ESBTYG",
"visitor_name": "Mary Brown",
"skill": 0,
"email": "mary.brown@mycompany.com",
"message": "Your name: Mary Brown\r\nE-mail: mary.brown@mycompany.com\r\n\r\nMessage:\r\nHi, \nI'd like to ask about your products, can somebody contact me?\nBest regards,\nMary Brown\r\n\r\n"
},
{
"id": "M144DSLS7A",
"visitor_name": "Jane Doe",
"skill": 2,
"email": "jane.doe@company.com",
"message": "Your name: Jane Doe\r\nE-mail: jane.doe@company.com\r\n\r\nMessage:\r\nExample message\r\n\r\n"
},
{
...
}
],
"total": 32,
"pages": 2
}
Results are divided into pages, each containing 25 offline messages.
total tells you the total number of messages.pages tells you the total number of pages.
To access next pages of the results, use ?page=<PAGE> parameter.
Please note that first page’s number is 1, not 0.
Example request for the second page:
curl -u LOGIN:API_KEY https://api.livechatinc.com/offline_messages?page=2
Get single offline message
GET https://api.livechatinc.com/offline_messages/<MESSAGE_ID>
Returns single offline message item for the given MESSAGE_ID.
Example request:
curl -u LOGIN:API_KEY https://api.livechatinc.com/offline_messages/M144ESBTYG
Return format is the same as the single offline message item in offline messages list:
{
"id": "M144ESBTYG",
"visitor_name": "Mary Brown",
"skill": 0,
"email": "mary.brown@mycompany.com",
"message": "Your name: Mary Brown\r\nE-mail: mary.brown@mycompany.com\r\n\r\nMessage:\r\nHi, \nI'd like to ask about your products, can somebody contact me?\nBest regards,\nMary Brown\r\n\r\n"
}