$value ){ $option_name = $app . '_' . $key; $value = sanitize_text_field( $value ); update_option( $option_name, $value ); } } if( ! isset($_POST[$app]['enabled']) ){ $k = $app . '_enabled'; $value = 0; update_option( $k, $value ); } } // $this->initOption(); $current = array(); $current['enabled'] = get_option( $app . '_enabled', 1 ); $current['auth_code'] = get_option( $app . '_auth_code', '' ); $startUrl = '/shiftcontroller/v4/'; // spaghetti starts here ?>
app ); ?>

Get Shifts

GET

__Headers__

X-WP-ShiftController-AuthCode:

__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)

root(); $cfieldsQuery = $f->make('SH4_CFields_Query'); $cfields = $cfieldsQuery->read(); ?>

__Optional Arguments__

getName(); ?> (getLabel(); ?>)

__Examples__

GET 
GET ?calendar_id=11&from=20210224
GET ?from=202102240900&to=202102241430&status_id=draft

__Get Shift__

GET

__Headers__

X-WP-ShiftController-AuthCode:

__Examples__

GET /123

__Delete Shift__

DELETE

__Headers__

X-WP-ShiftController-AuthCode:

__Examples__

DELETE /123

__Create Shift__

POST

__Headers__

X-WP-ShiftController-AuthCode:

__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

Examples

POST 

calendar_id: 11
employee_id: 22
start: 202102240800
end: 202102241430
status_id: publish

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

__Update Shift__

PUT

__Headers__

X-WP-ShiftController-AuthCode:

__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

Examples

PUT /123
start: 202102240900
end: 202102241530
PUT /123
employee_id: 22
PUT /123
status_id: publish