REST API

As of version 4.8.4, ShiftController provides a number of REST API endpoints to query and update its shifts database.

Please note that each call requres the X-WP-ShiftController-AuthCode header set to the value from your ShiftController Administration > REST API form. In the examples on this page we use 123.

Get Shifts

GET /shiftcontroller/v4/shifts

Headers

X-WP-ShiftController-AuthCode: 123

Arguments

calendar_id (Calendar Id)
employee_id (Employee Id)
from (From Date, YYYYMMDD / From Date Time, YYYYMMDDHHMM)
to (To Date, YYYYMMDD / To Date Time, YYYYMMDDHHMM)
status_id (publish, draft)

Examples

GET https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts
GET https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts?calendar_id=11&from=20210224
GET https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts?from=202102240900&to=202102241430&status_id=draft

Get Shift

GET /shiftcontroller/v4/shifts/<id>

Headers

X-WP-ShiftController-AuthCode: 123

Examples

GET https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts/123

Delete Shift

DELETE /shiftcontroller/v4/shifts/<id>

Headers

X-WP-ShiftController-AuthCode: 123

Examples

DELETE https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts/123

Create Shift

POST /shiftcontroller/v4/shifts

Headers

X-WP-ShiftController-AuthCode: 123

Arguments

calendar_id (Calendar Id)
employee_id (Employee Id)
start (Start Date Time, YYYYMMDDHHMM)
end (End Date Time, YYYYMMDDHHMM)
status_id (publish, draft)
conflict (Set to 1 to allow creation of shifts with conflicts) optional

If you have custom fields in this calendar, then you can add them too as miscXXX where XXX is the field id (see Administration > Calendars > Custom Fields):

misc11
misc12

Examples

POST /shiftcontroller/v4/shifts
calendar_id: 11
employee_id: 22
start: 202102240800
end: 202102241430
status_id: publish

if you have custom fields

misc11: orange
misc12: 321

If success, it returns the id of the new shift. Otherwise error messages will be given.

Update Shift

PUT /shiftcontroller/v4/shifts/<id>

Headers

X-WP-ShiftController-AuthCode: 123

Arguments

calendar_id (Calendar Id) optional
employee_id (Employee Id) optional
start (Start Date Time, YYYYMMDDHHMM) optional
end (End Date Time, YYYYMMDDHHMM) optional
status_id (publish, draft) optional
conflict (Set to 1 to allow creation of shifts with conflicts) optional

If you have custom fields in this calendar, then you can add them too as miscXXX where XXX is the field id (see Administration > Calendars > Custom Fields):

misc11
misc12

Examples

PUT https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts//123
start: 202102240900
end: 202102241530
PUT https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts//123
employee: 22
PUT https://www.yoursite.com/wp-json/shiftcontroller/v4/shifts//123
status_id: publish

Order Now

Get the Pro version for a lot more nice features

Buy Now

Contact Us

Please contact us should you have any questions.