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", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 }
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", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 }
- JSON Parameters:
begin (datetime) – An ISO8601 datetime representing the start of the registration
dienst_id (int) – the id of the shift this registration is for
eind (datetime) – An ISO8601 datetime representing the end of the registration
noot (string) – Optional An optional note
pauze_minuten (int) – the number of minutes the staff member was on break
personeel_id (int) – the id of the staff member
- Response Headers:
Location – The location of the new registration
- Status Codes:
201 Created – Registration recorded
406 Not Acceptable – Error in the input
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
Voorbeeld 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": { "id": 182, "boeking_id": null, "locatie_id": null, "product_id": null, "kwalificatie_id": null, "begin": "2021-02-20T09:00:00+01:00", "eind": "2021-02-20T17:00:00+01:00", "status": "bevestigd", "opmerking": "", "noot": "", "personeel_id": 42 }, "Personeel": { "id": 42, "displaynaam": "Tim the Enchanter", "naam": "", "bedrijf_id": 1 }, "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 } ]
- 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": { "id": 42, "displaynaam": "Tim the Enchanter", "naam": "", "bedrijf_id": 1 }, "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 }
- 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", "dienst_id": 182, "eind": "2021-02-20T16:50:00+01:00", "id": 179, "noot": "It was even earlier that I left", "pauze_minuten": 25, "personeel_id": 42 }
Voorbeeld response:
HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:50:00+01:00", "id": 179, "noot": "It was even earlier that I left", "pauze_minuten": 25, "personeel_id": 42 }
- JSON Parameters:
id (int) – ID of the registration, cannot be changed
- Status Codes:
200 OK – Registration altered
406 Not Acceptable – Error in the input
403 Forbidden – 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
Voorbeeld response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Registration deleted
403 Forbidden – User does not have the permission
editPersoneelsplanning