Search Visitor Chat

Prev Next
Get
/api/v1/livechat/visitors.searchChats/room/{roomId}/visitor/{visitorId}

Get the Livechat information of a visitor. This endpoint returns only those chats that are served and closed.

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Path parameters
roomId
stringRequired

The room ID.

visitorId
stringRequired

The visitor ID.

Query parameters
offset
integer

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.

Example50
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example25
sort

Sort the events in the ascending (1) or descending (-1) order. By default, the result is sorted in descending order. The most recent chats are returned first. Enter the value as: sort[ts]=1 or sort[ts]=-1. Here ts refers to timestamp.

searchText
string

Enter the text to search for within the chat.

closedChatsOnly
string

Filter the results to display only closed chats. The value can be "true" or "false".

servedChatsOnly
string

Filter the results to display only chats that are joined by agents. The value can be "true" or "false".

source
string

Filter the results by the source of the chat. The value can be: widget, sms, api, email, app, other.

Responses
200
Success Example
{
  "history": [
    {
      "_id": "hhMKhHnnbY79mGs9K",
      "msgs": 2,
      "fname": "Maria",
      "ts": "2021-07-22T17:17:04.216Z",
      "v": {
        "_id": "QyBAKC5Wc8tcv6cco",
        "username": "guest-537",
        "token": "8s7e9ony6ctl27e1qf8kue",
        "status": "online",
        "lastMessageTs": "2021-07-22T17:17:04.937Z"
      }
    }
  ],
  "count": 1,
  "offset": 0,
  "total": 1,
  "success": true
}
Expand All
object
history
Array of object
object
_id
string
msgs
integer
fname
string
ts
string
v
object
_id
string
username
string
token
string
status
string
lastMessageTs
string
count
integer
offset
integer
total
integer
success
boolean
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string