Permission required: manage-livechat-departments
Changelog
Version | Description |
---|---|
1.0.0 | New fields for department updated |
0.42.0 | Added |
The authToken
of the authenticated user.
The userId
of the authenticated user.
{
"department": {
"enabled": false,
"showOnRegistration": true,
"name": "new from api",
"email": "[email protected]",
"showOnOfflineForm": true
},
"agents": [
{
"agentId": "SQafHvoFPuB57NmBD"
}
],
"departmentUnit": {
"_id": "66f46dc59a0766c20712d698"
}
}
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 Livechat 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 object with the agent details that you want to add to the department.
The agent ID that you want to assign to the department.
The number of chats served by the agent. Enter a value if you want to reset the stored value. Note: This field is used by the routing algorithm to determine the agents that have served the least number of chats and assign new chats to them.
The order in which the agents are assigned to chats.
Assign the department to a unit.
Guidelines for assigning departments to a unit
The id of the unit to assign the department.
OK
{
"department": {
"enabled": false,
"name": "new from api",
"numAgents": 1,
"showOnRegistration": true,
"_updatedAt": "2016-12-13T17:22:19.109Z",
"_id": "iTfLCX3qqwKgf5uqg"
},
"agents": [
{
"agentId": "SQafHvoFPuB57NmBD",
"count": 0,
"order": 0
}
],
"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"
}