If the person/service/resource does not yet have a schedule you will need to create it and assign it to them.
Create schedule
Endpoint:
https://example.jrni.com/api/v5/admin/{company_id}/schedules
Request:
curl https://example.jrni.com/api/v5/admin/1/schedules -H App-Id:1234 -X POST \
-H Auth-Token:xyz -H Content-Type:application/json
Assign schedule to staff member
Endpoint:
https://example.jrni.com/api/v5/admin/{company_id}/people/{person_id}
Request:
curl https://example.jrni.com/api/v5/admin/1/people/1 -H App-Id:1234 -X PUT \
-H Auth-Token:xyz -H Content-Type:application/json \
-d '{ "schedule_id": 123 }'
Create shifts
Endpoint:
https://example.jrni.com/api/v5/admin/{company_id}/schedules/{schedule_id}/shifts
Request:
curl https://example.jrni.com/api/v5/admin/1/schedules/123/shift_patterns \
-H App-Id:1234 -X POST -H Auth-Token:xyz -H Content-Type:application/json \
-d '{
"start_date": "2018-04-01",
"end_date": "2018-04-02",
"shifts": [{
"date": "2018-04-01",
"start": "09:00",
"end": "18:00"
}, {
"date": "2018-04-02",
"start": "09:00",
"end": "12:00"
}, {
"date": "2018-04-02",
"start": "13:00",
"end": "18:00"
}]
}'