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", "eind": "2021-02-20T16:00:00.000Z", "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept" }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/diensten/1812 { "begin": "2021-02-20T08:00:00.000Z", "boeking_id": null, "eind": "2021-02-20T16:00:00.000Z", "id": 1812, "internal_reference": null, "kwalificatie_id": null, "locatie_id": null, "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept" }
- JSON Parameters:
begin (datetime) – An ISO8601 datetime representing the start of the shift
boeking_id (int) – The id of the associated booking, in case of a booking shift
eind (datetime) – An ISO8601 datetime representing the end of the shift
kwalificatie_id (int) – the id of the associated qualification
locatie_id (int) – the id of the associated location, in case of a location shift
noot (string) – An optional note for the planning department
opmerking (string) – An optional remark that is visible in the staff planning
personeel_id (int) – the id of the staff member
status (string) – the status of the shift. Can be one of:
concept
,gevraagd
(asked),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
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", "boeking_id": null, "created_by": null, "eind": "2021-02-20T16:00:00.000Z", "id": 1812, "internal_reference": null, "kwalificatie_id": null, "locatie_id": null, "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept", "Taken": [] } ]
- Query Parameters:
opDatum (ISO8601-date) – Show only shifts that (partially) take place on the given date.
- 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", "boeking_id": null, "created_by": null, "eind": "2021-02-20T16:00:00.000Z", "id": 1812, "internal_reference": null, "kwalificatie_id": null, "locatie_id": null, "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept", "Taken": [] }
- 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", "boeking_id": null, "eind": "2021-02-20T16:00:00.000Z", "id": 1812, "internal_reference": null, "kwalificatie_id": null, "locatie_id": null, "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept" }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T08:00:00.000Z", "boeking_id": null, "eind": "2021-02-20T16:00:00.000Z", "id": 1812, "internal_reference": null, "kwalificatie_id": null, "locatie_id": null, "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept" }
- JSON Parameters:
id (int) – ID of the shift, cannot be changed
- Status Codes:
200 OK – Shift updated
406 Not Acceptable – Error in the input
403 Forbidden – 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
Changelog¶
1.1.0 - Added ?opDatum=2024-05-07
parameter for GET requests