Gets all the available departments.
HTTP Method | URL | Requires Auth |
---|---|---|
GET | /api/v1/livechat/units/:unitId/departments/available | yes |
{% hint style="info" %}
Permission required: manage-livechat-units
{% endhint %}
Key | Example Value | Description |
---|---|---|
unitId * | sriw2wmP2Zz2pPrre | The unit ID. |
This endpoint supports the optional count
and offset
#pagination parameters. Additional optional parameters are as follows:
Key | Example Value | Description |
---|---|---|
text | test | The text with which you want to filter the result. |
onlyMyDepartments | true | Displays the departments that you are part of. |
{% code overflow="wrap" %}
curl --location --request GET 'http://localhost:3000/api/v1/livechat/units/TGjc7wN84KxQup9cF/departments/available' \
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'
{% endcode %}
{
"departments": [
{
"_id": "Yi87Ju7eTHiZQ7CJt",
"enabled": false,
"name": "Customer Success",
"description": "TEST",
"showOnRegistration": false,
"showOnOfflineForm": true,
"requestTagBeforeClosingChat": false,
"email": "",
"maxNumberSimultaneousChat": "",
"waitingQueueMessage": "TEST",
"type": "d",
"numAgents": 13,
"_updatedAt": "2021-06-28T22:10:01.360Z",
"ancestors": [
"sriw2wmP2Zz2pPrre"
],
"chatClosingTags": [],
"abandonedRoomsCloseCustomMessage": "",
"departmentsAllowedToForward": "",
"offlineMessageChannelName": "",
"visitorInactivityTimeoutInSeconds": "",
"parentId": "sriw2wmP2Zz2pPrre"
},
{
"_id": "fqjhjfuygXBRsPBJf",
"enabled": true,
"name": "Marketing Support",
"description": "Issues about merchandising actions",
"numAgents": 3,
"showOnRegistration": false,
"showOnOfflineForm": false,
"email": "",
"_updatedAt": "2021-06-15T21:12:35.469Z",
"maxNumberSimultaneousChat": "",
"requestTagBeforeClosingChat": false,
"type": "d",
"waitingQueueMessage": "",
"chatClosingTags": [],
"abandonedRoomsCloseCustomMessage": "",
"departmentsAllowedToForward": "",
"offlineMessageChannelName": "",
"visitorInactivityTimeoutInSeconds": "",
}
],
"count": 2,
"offset": 0,
"total": 2,
"success": true
}