Links

Get Number of Chats

Gives the number of chat rooms by department.
HTTP Method
URL
Requires Auth
GET
/api/v1/livechat/analytics/departments/amount-of-chats
yes
Permission required: view-livechat-manager

Query Parameters

This endpoint supports the offset and count parameters from the Paginationquery parameters. The other parameters are as follows:
Key
Example Value
Description
start*
2020-09-09T00:11:22.345Z
The start date.
end*
2021-09-10T23:59:22.345Z
The end date.

Example Call

curl --location --request GET 'http://localhost:3000/api/v1/livechat/analytics/departments/amount-of-chats?start=2020-01-10T23:59:22.345Z&end=2021-02-10T23:59:22.345Z \
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'

Example Response

{
"departments": [
{
"rooms": 30,
"_id": null
},
{
"rooms": 486,
"_id": "GgYvrkAF63aeQmsh4"
},
{
"rooms": 13,
"_id": "qajzu7WaBRoQBpq6Z"
},
{
"rooms": 2,
"_id": "Z2KWYBJQFR7AzfmQL"
},
{
"rooms": 61,
"_id": "BiqbQav59HD2LzXEY"
},
{
"rooms": 1,
"_id": "NJaMpSvZFZ4NAXm3j"
},
{
"rooms": 181,
"_id": "CAJioQNAvLnYWTy8i"
},
{
"rooms": 6,
"_id": "YiWdMkdbFhk3o9daf"
},
{
"rooms": 10,
"_id": "8MGLTfaKLCbE9CqR8"
},
{
"rooms": 4,
"_id": "MpAiP9PMyHwBcmALx"
},
{
"rooms": 51,
"_id": "Yi87Ju7eTHiZQ7CJt"
}
],
"count": 11,
"offset": 0,
"total": 11,
"success": true
}
Last modified 6d ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.