Get a list of the departments. At least one of the following permissions is required:
view-livechat-departments
view-l-room
Changelog
Version | Description |
---|---|
2.2.0 | Added support to pagination |
0.42.0 | Added |
The authToken
of the authenticated user.
The userId
of the authenticated user.
Filter the result with any text.
Filter the result to only show enabled departments. The value can be boolean true or false.
You can include the archived departments in the result. The value can be boolean true or false.
This parameter is for users with managers or admin roles. It only displays the departments that you are an agent of.
The department ID that you want to exclude from the result.
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.
OK
{
"departments": [
{
"_id": "64181a0728384134ed600dcc",
"enabled": true,
"name": "Support",
"description": "",
"showOnRegistration": false,
"showOnOfflineForm": false,
"requestTagBeforeClosingChat": false,
"email": "[email protected]",
"chatClosingTags": [],
"offlineMessageChannelName": "Livestream",
"abandonedRoomsCloseCustomMessage": "",
"waitingQueueMessage": "",
"departmentsAllowedToForward": [],
"fallbackForwardDepartment": "",
"_updatedAt": "2023-10-13T13:03:58.406Z",
"numAgents": 4,
"type": "d"
},
{
"_id": "649230d479f5c6e276cf4a12",
"enabled": false,
"name": "Finance",
"description": "",
"showOnRegistration": false,
"showOnOfflineForm": false,
"requestTagBeforeClosingChat": false,
"email": "[email protected]",
"chatClosingTags": [],
"offlineMessageChannelName": "",
"abandonedRoomsCloseCustomMessage": "",
"waitingQueueMessage": "",
"departmentsAllowedToForward": [],
"fallbackForwardDepartment": "",
"type": "d",
"_updatedAt": "2023-10-13T13:03:58.426Z",
"numAgents": 3,
"businessHourId": "650dc9cfa2f73c7460e18bea"
}
],
"count": 2,
"offset": 0,
"total": 2,
"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"
}