- Print
- DarkLight
- PDF
Update Department
- Print
- DarkLight
- PDF
Update the details of a specific department. Permissions required:
manage-livechat-departments
- To add agents:
add-livechat-department-agents
Changelog
Version | Description |
---|---|
0.42.0 | Added |
The authToken
of the authenticated user.
The userId
of the authenticated user.
The department ID.
{
"department": {
"enabled": true,
"name": "new from api - live",
"showOnRegistration": true,
"email": "[email protected]",
"showOnOfflineForm": false
},
"agents": [
{
"agentId": "SQafHvoFPuB57NmBD",
"username": "john.doe"
}
]
}
The object which takes the department details.
Whether you want to enable the department. The value can be boolean true or false.
You can let visitors choose the department they want to talk to. The option will appear to your customer in the Live Chat widget. The value can be boolean true or false.
The name of the department you are creating.
The email ID associated with the department.
If you want your department to be displayed during off-business hours. The value can be boolean true or false.
A description of your department.
The agent ID that you want to assign to the department.
OK
{
"department": {
"_id": "iTfLCX3qqwKgf5uqg",
"enabled": true,
"name": "new from api - live",
"description": "update api",
"numAgents": 1,
"showOnRegistration": true,
"_updatedAt": "2016-12-13T17:30:02.643Z"
},
"agents": [
{
"_id": "DDjZbhTF74n3NBuWK",
"agentId": "SQafHvoFPuB57NmBD",
"departmentId": "iTfLCX3qqwKgf5uqg",
"username": "john.doe",
"count": 0,
"order": 0,
"_updatedAt": "2016-12-13T17:30:02.656Z"
}
],
"success": true
}
Bad Request
{
"success": false,
"error": "must have required property 'department' [invalid-params]",
"errorType": "invalid-params"
}
{
"success": false,
"error": "must have required property 'name' [invalid-params]",
"errorType": "invalid-params"
}
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"
}