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

Latest commit

 

History

History
71 lines (57 loc) · 4.32 KB

File metadata and controls

71 lines (57 loc) · 4.32 KB

Update Department

Update the details of a specific department.

HTTP MethodURLRequires Auth
PUT/api/v1/livechat/department/:_idyes

{% hint style="info" %} Permissions required:

  • manage-livechat-departments
  • add-livechat-department-agents {% endhint %}

Path Variables

KeyExample ValueDescription
_id*iTfLCX3qqwKgf5uqgThe department ID that you want to update.

Body Parameters

KeyExample ValueDescription
department*

{ "department":

{ ... } }

The object which takes the department details.
name*testDeptThe name of the department you are creating.
email*abc@testdept.comThe email ID associated with the department.
enabled*falseWhether you want to enable the department. The value can be boolean true or false.
showOnRegistration*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.

showOnOfflineForm*falseIf you want your department to be displayed during off-business hours.
The value can be boolean true or false.
descriptionTest departmentA description of your department.
agents

{ "agents":

{ ... } }

The object with the agent details that you want to add to the department.
agentIdSQafHvoFPuB57NmBDThe agent ID that you want to assign to the department.
count11The 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.
order1The order in which agents are assigned to chats.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -X PUT \
     -H "Content-type:application/json" \
     http://localhost:3000/api/v1/livechat/department/iTfLCX3qqwKgf5uqg \
    -d '{"department": {
            "enabled": true, 
            "name": "new from api - live", 
            "showOnRegistration": true}, 
    "agents": [{
            "agentId": "SQafHvoFPuB57NmBD", 
            "username": "john.doe"}] }'

Example Response

{
  "department": {
    "_id": "iTfLCX3qqwKgf5uqg",
    "enabled": true,
    "name": "new from api - live",
    "description": null,
    "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
}

Change Log

Version Description
0.42.0 Added