Department
  • 05 Sep 2022
  • 4 Minutes to read
  • Dark
    Light

Department

  • Dark
    Light

Article summary

Department

You need the Manage departments permission to manage departments.

Department JSON Format

Department is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the department.
namestringName of the department.
descriptionstringDescription of the department.
isAvailableInLiveChatboolWhen it is false, the department will not be displayed in the Pre-chat window, department drop down list, routing rules, chat transfer rules etc. Default: true.
isAvailableInTicketingAndMessagingboolWhen it is false, the department name will not be displayed in the 'Assigned Department' field. Default: true.
offlineMessageMailTostringAllowed values are "toAllAgents", "toEmailAddresses".
offlineMessageEmailAddressesstringSpecific email addresses that offline message are sent to. Available and required when Offline Message Mail Type is "toEmailAddresses".
agentIdsarrayId of the selected agents for this department.
isDeletedboolWhether the department is deleted or not.
chatbotStartTriggerActionIdsarrayThe guid array of chatbot smart trigger actions for the selected departments.
shiftIdsarrayThe guid array of shifts for the selected departments.
segmentIdsarrayThe guid array of segmentations for the selected departments.

Get the list of Departments

GET global/departments

  • Parameters:

NameTypeinRequiredDescription
keywordsstringquerynoFilter by keywords in name of the department.
includestringquerynoAllowed value is "agent".
  • Response:

An array of Department

  • Example

Sample Request:

curl https://api11.comm100.io/v4/global/departments \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "id": "a0831b44-a2d0-4bed-96c4-43f7eb69b095",
      "name": "markting",
      "description": "markting departments",
      "isAvailableInLiveChat": true,
      "isAvailableInTicketingAndMessaging": true,
      "offlineMessageMailTo": "toAllAgents",
      "offlineMessageEmailAddresses": "andy@comm100.com",
      "isDeleted": false,
      "agentIds": [
          "3CA2EF45-7D46-EB11-8100-00155D081D0B"
      ],
      "chatbotSmartTriggerActionIds": [
         "807dfb38-2c29-4fad-b1ee-910b37bacef4"
      ],
      "shiftIds": [
         "1dfd687b-68e8-4870-95e0-68052fd08bb5"
      ],
      "segmentIds": [
         "7f8c4778-2126-4ff3-a4ba-9089cf24159c"
      ]
  }
] 

Get a single Department

GET global/departments/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed value is "agent".
  • Response:

Department

  • Example

Sample Request:

curl https://api11.comm100.io/v4/global/departments/a0831b44-a2d0-4bed-96c4-43f7eb69b095 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "a0831b44-a2d0-4bed-96c4-43f7eb69b095",
  "name": "markting",
  "description": "markting departments",
  "isAvailableInLiveChat": true,
  "isAvailableInTicketingAndMessaging": true,
  "offlineMessageMailTo": "toAllAgents",
  "offlineMessageEmailAddresses": "andy@comm100.com",
  "isDeleted": false,
  "agentIds": [
      "3CA2EF45-7D46-EB11-8100-00155D081D0B"
  ],
   "chatbotSmartTriggerActionIds": [
      "807dfb38-2c29-4fad-b1ee-910b37bacef4"
  ],
  "shiftIds": [
      "1dfd687b-68e8-4870-95e0-68052fd08bb5"
   ],
   "segmentIds": [
      "7f8c4778-2126-4ff3-a4ba-9089cf24159c"
   ]
} 

Create a new Department

POST global/departments

  • Parameters:

NameTypeinRequiredDescription
namestringbodyyesName of the department.
descriptionstringbodynoDescription of the department.
isAvailableInLiveChatboolbodynoWhen it is false, the department will not be displayed in the Pre-chat window, department drop down list, routing rules, chat transfer rules etc. Default: true.
isAvailableInTicketingAndMessagingboolbodynoWhen it is false, the department name will not be displayed in the 'Assigned Department' field. Default: true.
offlineMessageMailTostringbodynoAllowed values are "toAllAgents", "toEmailAddresses".
offlineMessageEmailAddressesstringbodynoSpecific email addresses that offline message are sent to. Available and required when Offline Message Mail Type is "toEmailAddresses".
agentIdsarraybodynoId of the selected agents for this department.
isDeletedboolbodynoWhether the department is deleted or not.
chatbotStartTriggerActionIdsarraybodynoThe guid array of chatbot smart trigger actions for the selected departments.
shiftIdsarraybodynoThe guid array of shifts for the selected departments.
segmentIdsarraybodynoThe guid array of segmentations for the selected departments.
  • Response:

Department

  • Example

Sample Request:

curl https://api11.comm100.io/v4/global/departments \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com"}' 

Response:

HTTP/1.1 201 Created

{
  "id": "a0831b44-a2d0-4bed-96c4-43f7eb69b095",
  "name": "markting",
  "description": "markting departments",
  "isAvailableInLiveChat": true,
  "isAvailableInTicketingAndMessaging": true,
  "offlineMessageMailTo": "toAllAgents",
  "offlineMessageEmailAddresses": "andy@comm100.com",
  "isDeleted": false,
  "agentIds": [
      "3CA2EF45-7D46-EB11-8100-00155D081D0B"
  ],
  "chatbotSmartTriggerActionIds": [],
  "shiftIds": [],
  "segmentIds": []
} 

Update the Department

PUT global/departments/{id}

  • Parameters:

NameTypeinRequiredDescription
namestringbodyyesName of the department.
descriptionstringbodynoDescription of the department.
isAvailableInLiveChatboolbodynoWhen it is false, the department will not be displayed in the Pre-chat window, department drop down list, routing rules, chat transfer rules etc. Default: true.
isAvailableInTicketingAndMessagingboolbodynoWhen it is false, the department name will not be displayed in the 'Assigned Department' field. Default: true.
offlineMessageMailTostringbodynoAllowed values are "toAllAgents", "toEmailAddresses".
offlineMessageEmailAddressesstringbodynoSpecific email addresses that offline message are sent to. Available and required when Offline Message Mail Type is "toEmailAddresses".
agentIdsarraybodynoId of the selected agents for this department.
isDeletedboolbodynoWhether the department is deleted or not.
chatbotStartTriggerActionIdsarraybodynoThe guid array of chatbot smart trigger actions for the selected departments.
shiftIdsarraybodynoThe guid array of shifts for the selected departments.
segmentIdsarraybodynoThe guid array of segmentations for the selected departments.
  • Response:

Department

  • Example

Sample Request:

curl https://api11.comm100.io/v4/global/departments/a0831b44-a2d0-4bed-96c4-43f7eb69b095 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"name":"markting","description":"markting departments","isAvailableInLiveChat":true,"isAvailableInTicketingAndMessaging":true,"offlineMessageMailTo":"toAllAgents","offlineMessageEmailAddresses":"andy@comm100.com"}' 

Response:

HTTP/1.1 200 OK

{
  "id": "a0831b44-a2d0-4bed-96c4-43f7eb69b095",
  "name": "markting",
  "description": "markting departments",
  "isAvailableInLiveChat": true,
  "isAvailableInTicketingAndMessaging": true,
  "offlineMessageMailTo": "toAllAgents",
  "offlineMessageEmailAddresses": "andy@comm100.com",
  "isDeleted": false,
  "agentIds": [
      "3CA2EF45-7D46-EB11-8100-00155D081D0B"
  ],
  "chatbotSmartTriggerActionIds": [],
  "shiftIds": [],
  "segmentIds": []
} 

Remove the Department

DELETE global/departments/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/global/departments/a0831b44-a2d0-4bed-96c4-43f7eb69b095 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?