Shift Template Settings Via Web Portal
The Schedule Cycle must be set and known before you can understand which integer and string values to set for startDayIndex and startDayLabel respectively.
Via the API
Shift Template Settings are accessible via the dedicated action on the /clients endpoint:
/clients/{id}/actions/set-shift-template-settings
Shift Templates - [GET]
Example 1
Schedule Cycle: 7
First Period Start Date: 2020-07-29
2020-07-29 = Wednesday
Template created to Wednesday
Mapping
0 = WEDNESDAY
1 = THURSDAY
2 = FRIDAY
3 = SATURDAY
4 = SUNDAY
5 = MONDAY
6 = TUESDAY
-1 = CLOSED
[GET]/rest/v1/shift-templates/3732
Example 2
Schedule Cycle: 7
First Period Start Date: 2020-07-26
2020-07-26 = SUNDAY
Template created to Wednesday
Mapping
0 = SUNDAY
1 = MONDAY
2 = TUESDAY
3 = WEDNESDAY
4 = THURSDAY
5 = FRIDAY
6 = SATURDAY
-1 = CLOSED
[GET]/rest/v1/shift-templates/3733
Example 3
Schedule Cycle: 14
First Period Start Date: 2020-07-26
2020-07-26 = SUNDAY
2 Templates created, the first one to the first Wednesday and the other one to the second Wednesday
Mapping
0 = EVERY_1_SUNDAY 7 = EVERY_2_SUNDAY
1 = EVERY_1_MONDAY 8 = EVERY_2_MONDAY
2 = EVERY_1_TUESDAY 9 = EVERY_2_TUESDAY
3 = EVERY_1_WEDNESDAY 10 = EVERY_2_WEDNESDAY
4 = EVERY_1_THURSDAY 11 = EVERY_2_THURSDAY
5 = EVERY_1_FRIDAY 12 = EVERY_2_FRIDAY
6 = EVERY_1_SATURDAY 13 = EVERY_2_SATURDAY
-1 = CLOSED
[GET]/rest/v1/shift-templates?id:in=3734,3735
Example 4
Schedule Cycle: 3 (custom)
First Period Start Date: 2020-07-26
2020-07-26 = SUNDAY
Template created to the day 1
Mapping
0 = DAY_1
1 = DAY_2
2 = DAY_3
-1 = CLOSED
[GET]/rest/v1/shift-templates/3737
Shift Templates - [POST]
When importing a Shift Template it’s important to remember that the template will create shifts from the startDate value set in the Shift Template Settings (see the first section above of this document) when running the action:
/clients/{id}/actions/set-shift-template-settings
Examples
Schedule Cycle: 14
First Period Start Date: 2020-07-29
2020-07-29 = Wednesday
[POST]/rest/v1/shift-templates
Payload:
{
"position": 59,
"startTime": "09:00:00",
"endTime": "17:00:00",
"startDayIndex": 10,
"vacant": true or "employee": {employee_id}
}Response:
Validation group: employee, vacant, onShiftBoard
There is a validation group where depending on the true/false values of vacant and onShiftBoard, the employee field becomes necessary to include in payloads when POSTing a shift-template.
If the vacant field is omitted, false is assumed and employee will be required for example. So be sure to include:
"vacant" : true