Autocomplete Department

Prev Next
Get
/api/v1/livechat/department.autocomplete

Autocomplete the department name. At least one of the following permissions is required:

  • view-livechat-departments
  • view-l-room
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
selector
stringRequired

Enter the exceptions or the conditions that you want to search for.

Example{"exceptions" : ["${dep1._id}"], "conditions": {"enabled": true}, "term":"test"}
onlyMyDepartments
boolean

Only displays the departments that you are assigned to. The value can be boolean true or false

showArchived
boolean

The result includes archived departments. The value can be Boolean true or false.

Responses
200

OK

Example 1
{
  "departments": [
    {
      "_id": "qajzu7WaBRoQBpq6Z",
      "enabled": true,
      "name": "Brazil",
      "description": "",
      "numAgents": 3,
      "showOnRegistration": false,
      "showOnOfflineForm": true,
      "email": "[email protected]",
      "_updatedAt": "2021-06-23T06:02:02.931Z",
      "chatClosingTags": [],
      "maxNumberSimultaneousChat": "",
      "requestTagBeforeClosingChat": false,
      "type": "d",
      "waitingQueueMessage": "",
      "abandonedRoomsCloseCustomMessage": "",
      "departmentsAllowedToForward": "",
      "offlineMessageChannelName": "",
      "visitorInactivityTimeoutInSeconds": "",
      "ancestors": []
    },
    {
      "_id": "NhnC9dBwFonZqSQ5m",
      "enabled": true,
      "name": "CSM and Support",
      "description": "",
      "showOnRegistration": true,
      "showOnOfflineForm": false,
      "requestTagBeforeClosingChat": false,
      "email": "[email protected]",
      "chatClosingTags": [],
      "offlineMessageChannelName": "",
      "abandonedRoomsCloseCustomMessage": "",
      "waitingQueueMessage": "",
      "departmentsAllowedToForward": [
        "CAJioQNAvLnYWTy8i",
        "Z2KWYBJQFR7AzfmQL"
      ],
      "_updatedAt": "2021-07-12T18:05:53.257Z",
      "numAgents": 4
    }
  ],
  "count": 2,
  "offset": 0,
  "total": 2,
  "success": true
}
object
400

Bad Request

Example 1
{
  "success": false,
  "error": "The 'selector' param is required"
}
object
success
boolean
error
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string