Shifts

Current version: 1.0.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:

Read

GET /api2/diensten/(int: id)

Get a certain shift

Voorbeeld 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": []
   }
]
Status Codes:
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:

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"
}

Voorbeeld 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:

Delete

DELETE /api2/diensten/(int: id)

Example request:

DELETE /api2/diensten/1812 HTTP/1.1
Host: demo.recras.nl

Voorbeeld response:

HTTP/1.1 200 OK
Status Codes:
  • 200 OK – Shift deleted

  • 403 Forbidden – User does not have the permission editPersoneelsplanning