Shifts ====== Current version: 1.0.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", "eind": "2021-02-20T16:00:00.000Z", "noot": "Note for the planning department", "opmerking": "Publicly visible remark", "personeel_id": 42, "status": "concept" } **Example response**: .. sourcecode:: http 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 datetime begin: An ISO8601 datetime representing the start of the shift :json int boeking_id: The id of the associated booking, in case of a booking shift :json datetime eind: An ISO8601 datetime representing the end of the shift :json int kwalificatie_id: the id of the associated qualification :json int locatie_id: the id of the associated location, in case of a location shift :json string noot: An optional note for the planning department :json string opmerking: An optional remark that is visible in the staff planning :json int personeel_id: the id of the staff member :json string status: the status of the shift. Can be one of: ``concept``, ``gevraagd`` (asked), ``bevestigd`` (confirmed), ``geannuleerd`` (cancelled), ``geweigerd`` (declined) :resheader Location: The location of the new registration :statuscode 201: Shift created :statuscode 406: Error in the input :statuscode 403: User does not have the correct permission(s) Read ---- .. http:get:: /api2/diensten/(int:id) Get a certain shift **Voorbeeld 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", "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": [] } ] :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", "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": [] } :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", "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" } **Voorbeeld response**: .. sourcecode:: http 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 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 **Voorbeeld response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Shift deleted :statuscode 403: User does not have the permission ``editPersoneelsplanning``