Livechat Rooms list
Retrieves a list of livechat rooms.
URL
Requires Auth
HTTP Method
/api/v1/livechat/rooms
yes
GET

Query Parameters

Argument
Example
Required
Description
agents
['b32h3b2hhwb25d']
Optional
A list of agents, can be a list of ids or usernames
departmentId
AkzpHAvZpdnuchw2a
Optional
The department's id
open
true
Optional
If it should filter by open/closed rooms
createdAt
{"start": "2018-01-26T00:11:22.345Z", "end": "2018-01-26T00:11:22.345Z"}
Optional
An object representing when the room was created(Can also be filtered only with start or end)
closedAt
{"start": "2018-01-26T00:11:22.345Z", "end": "2018-01-26T00:11:22.345Z"}
Optional
An object representing when the room was closed(Can also be filtered only with start or end)
tags
['rocket', 'chat']
Optional
A list of tags
customFields
{"docId": "aobEdbYhXfu5hkeqG"}
Optional
An object with custom fields to be filtered(previously created and populated at custom fields endpoints)
roomName
room name
Optional
The room's name

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
http://localhost:3000/api/v1/livechat/rooms?agents[]=agent1&agents[]=agent2&departamentId=123&open=true&createdAt={"start": "2018-01-26T00:11:22.345Z", "end": "2018-01-26T00:11:22.345Z"}&closedAt={"start": "2018-01-26T00:11:22.345Z", "end": "2018-01-26T00:11:22.345Z"}&tags[]=rocket&customFields={"docId": "031041"}&count=3&offset=1&sort={"_updatedAt": 1}&fields={"msgs": 1}&roomName=test
Copied!

Example Result

1
{
2
"rooms": [
3
{
4
"_id": "9dQMveZhqxiDgCM3B",
5
"msgs": 1,
6
"usersCount": 1,
7
"lm": "2019-08-09T20:18:02.350Z",
8
"fname": "Marcos Defendi",
9
"t": "l",
10
"ts": "2019-08-09T20:18:02.108Z",
11
"v": {
12
"_id": "xh45w4y7oPW5SiMJu",
13
"username": "guest-4",
14
"token": "xn5hdkyptei11m07f3me",
15
"status": "online"
16
},
17
"servedBy": {
18
"_id": "3kyWm8PsmwhC7xgwg",
19
"username": "marcos",
20
"ts": "2019-08-09T20:18:02.109Z"
21
},
22
"cl": false,
23
"open": true,
24
"waitingResponse": true,
25
"departmentId": "xnmXQmytuvxp2TuSC",
26
"_updatedAt": "2019-08-09T20:19:34.856Z",
27
"lastMessage": {
28
"_id": "TBEz7zSCBaKsfyrzc",
29
"rid": "9dQMveZhqxiDgCM3B",
30
"msg": "Hello",
31
"token": "xn5hdkyptei11m07f3me",
32
"alias": "Marcos Defendi",
33
"ts": "2019-08-09T20:18:02.350Z",
34
"u": {
35
"_id": "xh45w4y7oPW5SiMJu",
36
"username": "guest-4",
37
"name": "Marcos Defendi"
38
},
39
"_updatedAt": "2019-08-09T20:18:02.383Z",
40
"mentions": [],
41
"channels": [],
42
"newRoom": false,
43
"showConnecting": false
44
},
45
"metrics": {
46
"v": {
47
"lq": "2019-08-09T20:18:02.350Z"
48
}
49
},
50
"livechatData": {
51
"docId": "0310584343112"
52
},
53
"tags": [
54
"rocket",
55
"chat"
56
],
57
"name": "Marcos Defendi"
58
}
59
],
60
"count": 1,
61
"offset": 1,
62
"total": 7,
63
"success": true
64
}
Copied!

Change Log

Version
Description
2.4.0
Added support to the parameter roomName
2.0.0
Added
Last modified 4mo ago
Export as PDF
Copy link
Edit on GitHub