Shifts¶
Current version: 1.1.0
Create¶
- POST /api2/personeel/42/uren¶
Record new hours
Example request:
POST /api2/diensten HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T08:00:00.000Z", // (start) "eind": "2021-02-20T16:00:00.000Z", // (end) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept" // (draft) }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/diensten/1812 { "begin": "2021-02-20T08:00:00.000Z", // (start) "boeking_id": null, // (booking_id) "eind": "2021-02-20T16:00:00.000Z", // (end) "id": 1812, "internal_reference": null, "kwalificatie_id": null, // (qualification_id) "locatie_id": null, // (location_id) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept" // (draft) }
- JSON Parameters:
begin (datetime) – An ISO8601 datetime representing the start (begin) of the shift
boeking_id (int) – The id of the associated booking (boeking_id), in case of a booking shift
eind (datetime) – An ISO8601 datetime representing the end (eind) of the shift
kwalificatie_id (int) – the id of the associated qualification (kwalificatie_id)
locatie_id (int) – the id of the associated location (locatie_id), in case of a location shift
noot (string) – An optional note (noot) for the planning department
opmerking (string) – An optional remark (opmerking) that is visible in the staff planning
personeel_id (int) – the id of the staff member (personeel_id)
status (string) – the status of the shift. Can be one of:
concept
(draft),gevraagd
(requested),bevestigd
(confirmed),geannuleerd
(cancelled),geweigerd
(declined)
- Response Headers:
Location – The location of the new registration
- Status Codes:
201 Created – Shift created
406 Not Acceptable – Error in the input (Fout in de invoer)
403 Forbidden – User does not have the correct permission(s)
Read¶
- GET /api2/diensten¶
Get a list of shifts
Example request:
GET /api2/diensten HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "begin": "2021-02-20T08:00:00.000Z", // (start) "boeking_id": null, // (booking_id) "created_by": null, "eind": "2021-02-20T16:00:00.000Z", // (end) "id": 1812, "internal_reference": null, "kwalificatie_id": null, // (qualification_id) "locatie_id": null, // (location_id) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept", // (draft) "Taken": [] // (Tasks) } ]
- Query Parameters:
opDatum (ISO8601-date) – Show only shifts that (partially) take place on the given date. (opDatum means onDate)
- Status Codes:
200 OK – no error
- GET /api2/diensten/(int: id)¶
A specific shift
Example request:
GET /api2/diensten/1812 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T08:00:00.000Z", // (start) "boeking_id": null, // (booking_id) "created_by": null, "eind": "2021-02-20T16:00:00.000Z", // (end) "id": 1812, "internal_reference": null, "kwalificatie_id": null, // (qualification_id) "locatie_id": null, // (location_id) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept", // (draft) "Taken": [] // (Tasks) }
- Status Codes:
200 OK – OK
404 Not Found – No shift with this
id
Update¶
- PUT /api2/diensten/(int: id)¶
Example request:
PUT /api2/diensten/1812 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T08:00:00.000Z", // (start) "boeking_id": null, // (booking_id) "eind": "2021-02-20T16:00:00.000Z", // (end) "id": 1812, "internal_reference": null, "kwalificatie_id": null, // (qualification_id) "locatie_id": null, // (location_id) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept" // (draft) }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T08:00:00.000Z", // (start) "boeking_id": null, // (booking_id) "eind": "2021-02-20T16:00:00.000Z", // (end) "id": 1812, "internal_reference": null, "kwalificatie_id": null, // (qualification_id) "locatie_id": null, // (location_id) "noot": "Note for the planning department", // (note) "opmerking": "Publicly visible remark", // (remark) "personeel_id": 42, // (staff_id) "status": "concept" // (draft) }
- json int id:
ID of the shift, cannot be changed
- statuscode 200:
Shift updated
- statuscode 406:
Error in the input
- statuscode 403:
User does not have the correct permission(s)
Delete¶
- DELETE /api2/diensten/(int: id)¶
Example request:
DELETE /api2/diensten/1812 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Shift deleted
403 Forbidden – User does not have the permission
editPersoneelsplanning
(editStaffRoster)
Changelog¶
1.1.0 - Added ?opDatum=2024-05-07
(onDate) parameter for GET requests