Get
/api/v1/livechat/department/{_id}
Get information about a specific department using the department ID. At least one of the following permissions is required:
view-livechat-departments
view-l-room
Changelog
Version | Description |
---|---|
2.2.0 | Added includeAgents query parameter |
0.42.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Path parameters
_id
stringRequired
The department ID.
Query parameters
includeAgents
boolean
If agents should be included in the result. By default, the value is true and the list of agents is returned. The agents field will only be returned if the user has the view-livechat-departments
permission.
ExampleTrue
Responses
200
OK
Success Example
{
"department": {
"_id": "iTfLCX3qqwKgf5uqg",
"enabled": false,
"name": "new from api",
"description": "creating a department",
"numAgents": 1,
"showOnRegistration": true,
"_updatedAt": "2016-12-13T17:22:19.109Z"
},
"agents": [
{
"_id": "DDjZbhTF74n3NBuWK",
"agentId": "SQafHvoFPuB57NmBD",
"departmentId": "iTfLCX3qqwKgf5uqg",
"username": "john.doe",
"count": 0,
"order": 0,
"_updatedAt": "2016-12-13T17:22:19.169Z"
}
],
"success": true
}
object
department
object
_id
string
enabled
boolean
name
string
description
string
numAgents
integer
showOnRegistration
boolean
_updatedAt
string
agents
Array of object
object
_id
string
agentId
string
departmentId
string
username
string
count
integer
order
integer
_updatedAt
string
success
boolean
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string
403
Forbidden
Permission Error
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
"success": false,
"error": "unauthorized"
}
object
success
boolean
error
string