Get the chat history of a Livechat visitor. The response does not include the visitor token in the v and lastMessage objects.
Changelog
| Version | Description |
|---|---|
| 8.9.0 | Removed the visitor token from v and lastMessage. |
The authToken of the authenticated user.
The userId of the authenticated user.
The room ID.
The visitor ID.
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
List of fields to order by, and in which direction. JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, sort = {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
{
"history": [
{
"_id": "hhMKhHnnbY79mGs9K",
"msgs": 2,
"usersCount": 1,
"lm": "2021-07-22T17:17:04.937Z",
"fname": "Maria",
"t": "l",
"ts": "2021-07-22T17:17:04.216Z",
"departmentId": "CAJioQNAvLnYWTy8i",
"v": {
"_id": "QyBAKC5Wc8tcv6cco",
"username": "guest-537",
"status": "online",
"lastMessageTs": "2021-07-22T17:17:04.937Z"
},
"cl": false,
"open": true,
"_updatedAt": "2021-07-22T17:17:05.078Z",
"departmentAncestors": [
"sriw2wmP2Zz2pPrre"
],
"lastMessage": {
"_id": "YfrxZ6gmaYLpPTxFP",
"rid": "hhMKhHnnbY79mGs9K",
"msg": "hi",
"alias": "Maria",
"ts": "2021-07-22T17:17:04.937Z",
"u": {
"_id": "QyBAKC5Wc8tcv6cco",
"username": "guest-537",
"name": "Maria"
},
"unread": true,
"_updatedAt": "2021-07-22T17:17:05.044Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "hi"
}
]
}
],
"newRoom": false,
"showConnecting": true
},
"metrics": {
"reaction": {
"fd": "2021-07-22T17:17:04.449Z",
"ft": 0.233,
"tt": 0.233
},
"response": {
"avg": 0.233,
"fd": "2021-07-22T17:17:04.449Z",
"ft": 0.233,
"total": 1,
"tt": 0.233
},
"v": {
"lq": "2021-07-22T17:17:04.937Z"
}
},
"waitingResponse": true
}
],
"count": 1,
"offset": 0,
"total": 1,
"success": true
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}