Shifts ====== Current version: 1.1.0 Create ------ .. http:post:: /api2/personeel/42/uren Record new hours **Example request**: .. sourcecode:: http 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**: .. sourcecode:: http 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 datetime begin: An ISO8601 datetime representing the start (`begin`) of the shift :json int boeking_id: The id of the associated booking (`boeking_id`), in case of a booking shift :json datetime eind: An ISO8601 datetime representing the end (`eind`) of the shift :json int kwalificatie_id: the id of the associated qualification (`kwalificatie_id`) :json int locatie_id: the id of the associated location (`locatie_id`), in case of a location shift :json string noot: An optional note (`noot`) for the planning department :json string opmerking: An optional remark (`opmerking`) that is visible in the staff planning :json int personeel_id: the id of the staff member (`personeel_id`) :json string status: the status of the shift. Can be one of: ``concept`` (draft), ``gevraagd`` (requested), ``bevestigd`` (confirmed), ``geannuleerd`` (cancelled), ``geweigerd`` (declined) :resheader Location: The location of the new registration :statuscode 201: Shift created :statuscode 406: Error in the input (`Fout in de invoer`) :statuscode 403: User does not have the correct permission(s) Read ---- .. http:get:: /api2/diensten Get a list of shifts **Example request**: .. sourcecode:: http GET /api2/diensten HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http 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 ISO8601-date opDatum: Show only shifts that (partially) take place on the given date. (`opDatum` means onDate) :statuscode 200: no error .. http:get:: /api2/diensten/(int:id) A specific shift **Example request**: .. sourcecode:: http GET /api2/diensten/1812 HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http 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) } :statuscode 200: OK :statuscode 404: No shift with this ``id`` Update ------ .. http:put:: /api2/diensten/(int:id) **Example request**: .. sourcecode:: http 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**: .. sourcecode:: http 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 ------ .. http:delete:: /api2/diensten/(int:id) **Example request**: .. sourcecode:: http DELETE /api2/diensten/1812 HTTP/1.1 Host: demo.recras.nl **Example response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Shift deleted :statuscode 403: User does not have the permission ``editPersoneelsplanning`` (editStaffRoster) Changelog --------- 1.1.0 - Added ``?opDatum=2024-05-07`` (onDate) parameter for GET requests