Retrieves a list of Livechat rooms. You can use the available query parameters to filter the response. At least one of the following permissions is required:
view-livechat-rooms
view-l-room
Changelog
Version | Description |
---|---|
7.0.0 | Remove support of filtering by agent's username |
2.4.0 | Added support to the parameter roomName |
2.0.0 | Added |
The authToken
of the authenticated user.
The userId
of the authenticated user.
A list of agent IDs.
The department ID. You can also enter multiple IDs as an array of string values.
If it should filter by open/closed rooms.
An object representing when the room was created (can also be filtered only with start
or end
).
An object representing when the room was closed (can also be filtered only with start
or end
).
A list of tags.
An object with custom fields to be filtered (previously created and populated at custom fields endpoints)
The room's name.
Whether you want to include livechat rooms that are on hold or not.
Whether you want to include queued rooms or not.
Enter the unit IDs you want to include as an array of string values.
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.
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: fields = {"username": 1}
. Refer to the official documentation to learn more.
OK
{
"rooms": [
{
"_id": "9dQMveZhqxiDgCM3B",
"msgs": 1,
"usersCount": 1,
"lm": "2019-08-09T20:18:02.350Z",
"fname": "Marcos Defendi",
"t": "l",
"ts": "2019-08-09T20:18:02.108Z",
"v": {
"_id": "xh45w4y7oPW5SiMJu",
"username": "guest-4",
"token": "xn5hdkyptei11m07f3me",
"status": "online"
},
"servedBy": {
"_id": "3kyWm8PsmwhC7xgwg",
"username": "marcos",
"ts": "2019-08-09T20:18:02.109Z"
},
"cl": false,
"open": true,
"waitingResponse": true,
"departmentId": "xnmXQmytuvxp2TuSC",
"_updatedAt": "2019-08-09T20:19:34.856Z",
"lastMessage": {
"_id": "TBEz7zSCBaKsfyrzc",
"rid": "9dQMveZhqxiDgCM3B",
"msg": "Hello",
"token": "xn5hdkyptei11m07f3me",
"alias": "Marcos Defendi",
"ts": "2019-08-09T20:18:02.350Z",
"u": {
"_id": "xh45w4y7oPW5SiMJu",
"username": "guest-4",
"name": "Marcos Defendi"
},
"_updatedAt": "2019-08-09T20:18:02.383Z",
"mentions": [],
"channels": [],
"newRoom": false,
"showConnecting": false
},
"metrics": {
"v": {
"lq": "2019-08-09T20:18:02.350Z"
}
},
"livechatData": {
"docId": "0310584343112"
},
"tags": [
"rocket",
"chat"
],
"name": "Marcos Defendi"
}
],
"count": 1,
"offset": 1,
"total": 7,
"success": true
}
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}
Forbidden
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
{
"success": false,
"error": "unauthorized"
}