- Print
- DarkLight
- PDF
Get List of Livechat Rooms
- Print
- DarkLight
- PDF
Retrieves a list of Livechat rooms. At least one of the following permissions is required:
view-livechat-rooms
view-l-room
Changelog
Version | Description |
---|---|
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 agents, can be a list of IDs or usernames
The department ID
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
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.
The number of items to return.
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}
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}
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"
}