Shift
  • 16 Jun 2022
  • 4 Minutes to read
  • Dark
    Light

Shift

  • Dark
    Light

Article summary

Shift

You need the Manage Settings permission to manage Shifts.

Shift JSON Format

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

NameTypeDescription
idguidId of the shift.
timeZonestringTime zone of the shift.Value includes all Time Zone Option identifiers.
autoDetectDayLightSavingsTimeboolWhether auto detect Daylight Saving Time or not.
namestringName of the shift.
shiftHolidaysshiftHolidays[]Reference to Shift Holiday.
shiftWorkingHoursshiftWorkingHours[]Reference to Shift Working Hours.
agentIdsarrayThe list of the shift identifiers, which the agent belongs to.
departmentIdsarrayThe list of the shift ids which the department belongs to.

Shift Holiday JSON Format:

NameTypeDescription
idguidId of the shift holiday.
namestringName of the shift holiday.
holidayDatedatetimeDate of the shift holiday.
shiftIdguidId of the shift.

Shift Working Hours JSON Format:

NameTypeDescription
idguidId of the shift working hours.
shiftIdguidId of the shift.
dayOfWeekstringAllowed values are "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday".
startTimetimeStart time of the shift working hours.
endTimetimeEnd time of the shift working hours.
agentAwayStatusIdguidId of the agent away status.

Get the list of Shifts

GET livechat/shifts

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed values are "agent", "department", "shiftHoliday", "shiftWorkingHours".
  • Response:

An array of Shift

  • Example

Sample Request:

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

Response:

HTTP/1.1 200 OK

{
  "shifts": [
      {
          "id": "8CAF5329-7C46-EB11-8100-00155D081D0B",
          "timeZone": "China Standard Time",
          "autoDetectDayLightSavingsTime": false,
          "name": "shift",
          "shiftHolidays": [
              {
                  "id": "8FAF5329-7C46-EB11-8100-00155D081D0B",
                  "name": "shiftHoliday",
                  "holidayDate": "2021-05-01",
                  "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B"
              }
          ],
          "shiftWorkingHours": [
              {
                  "id": "92AF5329-7C46-EB11-8100-00155D081D0B",
                  "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B",
                  "dayOfWeek": "Monday",
                  "startTime": "09:00:00",
                  "endTime": "18:00:00",
                  "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B"
              }
          ],
          "agentIds": [
              "40A2EF45-7D46-EB11-8100-00155D081D0B"
          ],
          "departmentIds": [
              "6fd98c99-f183-4247-bdda-47491426e577"
          ]
      }
  ],
  "nextPage": null,
  "previousPage": null,
  "total": 1
} 

Get a single Shift

GET livechat/shifts/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed values are "agent", "department", "shiftHoliday", "shiftWorkingHours".
  • Response:

Shift

  • Example

Sample Request:

curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "8CAF5329-7C46-EB11-8100-00155D081D0B",
  "timeZone": "China Standard Time",
  "autoDetectDayLightSavingsTime": false,
  "name": "shift",
  "shiftHolidays": [
      {
          "id": "8FAF5329-7C46-EB11-8100-00155D081D0B",
          "name": "shiftHoliday",
          "holidayDate": "2021-05-01",
          "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "shiftWorkingHours": [
      {
          "id": "92AF5329-7C46-EB11-8100-00155D081D0B",
          "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B",
          "dayOfWeek": "Monday",
          "startTime": "09:00:00",
          "endTime": "18:00:00",
          "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "agentIds": [
      "40A2EF45-7D46-EB11-8100-00155D081D0B"
  ],
  "departmentIds": [
      "6fd98c99-f183-4247-bdda-47491426e577"
  ]
} 

Create a new Shift

POST livechat/shifts

  • Parameters:

NameTypeinRequiredDescription
timeZonestringbodyyesTime zone of the shift.Value includes all Time Zone Option identifiers.
autoDetectDayLightSavingsTimeboolbodynoWhether auto detect Daylight Saving Time or not.
namestringbodyyesName of the shift.
shiftHolidaysshiftHolidays[]bodynoReference to Shift Holiday.
shiftWorkingHoursshiftWorkingHours[]bodynoReference to Shift Working Hours.
agentIdsarraybodynoThe list of the shift identifiers, which the agent belongs to.
departmentIdsarraybodynoThe list of the shift ids which the department belongs to.
  • Response:

Shift

  • Example

Sample Request:

curl https://api11.comm100.io/v4/livechat/shifts \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"timeZone":"China Standard Time","autoDetectDayLightSavingsTime":false,"name":"shift","shiftHolidays":[{"name":"shiftHoliday","holidayDate":"2021-05-01"}],"shiftWorkingHours":[{"dayOfWeek":"Monday","startTime":"09:00:00","endTime":"18:00:00","agentAwayStatusId":"DFAF5329-7C46-EB11-8100-00155D081D0B"}]}' 

Response:

HTTP/1.1 201 Created

{
  "id": "8CAF5329-7C46-EB11-8100-00155D081D0B",
  "timeZone": "China Standard Time",
  "autoDetectDayLightSavingsTime": false,
  "name": "shift",
  "shiftHolidays": [
      {
          "id": "8FAF5329-7C46-EB11-8100-00155D081D0B",
          "name": "shiftHoliday",
          "holidayDate": "2021-05-01",
          "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "shiftWorkingHours": [
      {
          "id": "92AF5329-7C46-EB11-8100-00155D081D0B",
          "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B",
          "dayOfWeek": "Monday",
          "startTime": "09:00:00",
          "endTime": "18:00:00",
          "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "agentIds": [
      "40A2EF45-7D46-EB11-8100-00155D081D0B"
  ],
  "departmentIds": [
      "6fd98c99-f183-4247-bdda-47491426e577"
  ]
} 

Update the Shift

PUT livechat/shifts/{id}

  • Parameters:

NameTypeinRequiredDescription
timeZonestringbodyyesTime zone of the shift.Value includes all Time Zone Option identifiers.
autoDetectDayLightSavingsTimeboolbodynoWhether auto detect Daylight Saving Time or not.
namestringbodyyesName of the shift.
shiftHolidaysshiftHolidays[]bodynoReference to Shift Holiday.
shiftWorkingHoursshiftWorkingHours[]bodynoReference to Shift Working Hours.
agentIdsarraybodynoThe list of the shift identifiers, which the agent belongs to.
departmentIdsarraybodynoThe list of the shift ids which the department belongs to.
  • Response:

Shift

  • Example

Sample Request:

curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"timeZone":"China Standard Time","autoDetectDayLightSavingsTime":false,"name":"shift","shiftHolidays":[{"name":"shiftHoliday","holidayDate":"2021-05-01"}],"shiftWorkingHours":[{"dayOfWeek":"Monday","startTime":"09:00:00","endTime":"18:00:00","agentAwayStatusId":"DFAF5329-7C46-EB11-8100-00155D081D0B"}]}' 

Response:

HTTP/1.1 200 OK

{
  "id": "8CAF5329-7C46-EB11-8100-00155D081D0B",
  "timeZone": "China Standard Time",
  "autoDetectDayLightSavingsTime": false,
  "name": "shift",
  "shiftHolidays": [
      {
          "id": "8FAF5329-7C46-EB11-8100-00155D081D0B",
          "name": "shiftHoliday",
          "holidayDate": "2021-05-01",
          "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "shiftWorkingHours": [
      {
          "id": "92AF5329-7C46-EB11-8100-00155D081D0B",
          "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B",
          "dayOfWeek": "Monday",
          "startTime": "09:00:00",
          "endTime": "18:00:00",
          "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B"
      }
  ],
  "agentIds": [
      "40A2EF45-7D46-EB11-8100-00155D081D0B"
  ],
  "departmentIds": [
      "6fd98c99-f183-4247-bdda-47491426e577"
  ]
} 

Remove the Shift

DELETE livechat/shifts/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?

What's Next