Recorded hours¶
Current version: 1.0.0
Create¶
- POST /api2/personeel/42/uren¶
Record new hours
Example request:
POST /api2/personeel/42/uren HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/personeel/42/uren/179 { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) }
- JSON Parameters:
begin (datetime) – An ISO8601 datetime representing the start (begin) of the registration
dienst_id (int) – the id of the shift (dienst) this registration is for
eind (datetime) – An ISO8601 datetime representing the end (eind) of the registration
noot (string) – Optional An optional note (noot)
pauze_minuten (int) – the number of minutes the staff member was on break (pauze_minuten means break_minutes)
personeel_id (int) – the id of the staff member (personeel_id means staff_id)
- Response Headers:
Location – The location of the new registration
- Status Codes:
201 Created – Registration recorded
406 Not Acceptable – Error in the input (Fout in de invoer)
403 Forbidden – User does not have the correct permission(s)
Read¶
- GET /api2/personeel/42/uren¶
Get the recorded hours of a certain staff member
Example request:
GET /api2/personeel/42/uren HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "Dienst": { // (Shift) "id": 182, "boeking_id": null, // (booking_id) "locatie_id": null, // (location_id) "product_id": null, "kwalificatie_id": null, // (qualification_id) "begin": "2021-02-20T09:00:00+01:00", // (start) "eind": "2021-02-20T17:00:00+01:00", // (end) "status": "bevestigd", // (status: "confirmed") "opmerking": "", // (remark) "noot": "", // (note) "personeel_id": 42 // (staff_id) }, "Personeel": { // (Staff) "id": 42, "displaynaam": "Tim the Enchanter", // (display_name) "naam": "", // (name) "bedrijf_id": 1 // (company_id) }, "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } ]
- Status Codes:
200 OK – no error
- GET /api2/personeel/42/uren/(int: id)¶
A specific hour registration
Example request:
GET /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "Personeel": { // (Staff) "id": 42, "displaynaam": "Tim the Enchanter", // (display_name) "naam": "", // (name) "bedrijf_id": 1 // (company_id) }, "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) }
- Status Codes:
200 OK – OK
404 Not Found – No recorded hour with this
id
Update¶
- PUT /api2/producten/(int: id)¶
Example request:
PUT /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:50:00+01:00", // (end) "id": 179, "noot": "It was even earlier that I left", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:50:00+01:00", // (end) "id": 179, "noot": "It was even earlier that I left", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) }
- json int id:
ID of the registration, cannot be changed
- statuscode 200:
Registration altered
- statuscode 406:
Error in the input
- statuscode 403:
User does not have the correct permission(s)
Delete¶
- DELETE /api2/personeel/(int: id)/uren/(int: id)¶
Example request:
DELETE /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Registration deleted
403 Forbidden – User does not have the permission
editPersoneelsplanning
(editStaffRoster)