Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
79 lines (68 loc) · 3.42 KB

File metadata and controls

79 lines (68 loc) · 3.42 KB

Get List of Departments

Get a list of the departments.

HTTP MethodURLRequires Auth
GET/api/v1/livechat/departmentyes

Query Parameters

This endpoint supports the #pagination parameters. Additional optional query parameters are as follows:

KeyExample ValueDescription
textfinFilter the result with any text.
enabledtrueFilter the result to only show enabled departments. The value can be boolean true or false.
showArchivedtrueYou can include the archived departments in the result. The value can be boolean true or false.
onlyMyDepartmentstrueThis parameter is for users with managers or admin roles. It only displays the departments that you are an agent of.
excludeDepartmentId64181a0728384134ed600dccThe department ID that you want to exclude from the result.

Example Call

curl --location 'http://localhost:3000/api/v1/livechat/department' \
--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQ' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC' \
--data ''

Example Response

{
    "departments": [
        {
            "_id": "64181a0728384134ed600dcc",
            "enabled": true,
            "name": "Support",
            "description": "",
            "showOnRegistration": false,
            "showOnOfflineForm": false,
            "requestTagBeforeClosingChat": false,
            "email": "kim.jane@rocketchat.com",
            "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": "test@gmail.com",
            "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
}

Change Log

Version Description
2.2.0 Added support to pagination
0.42.0 Added