Materials (Materialen)¶
Current version: 1.0.0
Create¶
- POST /api2/materialen¶
Create a new material
Example request:
POST /api2/materialen HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "Fiets", }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/materialen/5 { "id": 1, "naam": "Fiets", // (name: "Bicycle") "aantal": null, // (quantity) "aantal_groepen": null, // (number_of_groups) "aantal_tegelijk_starten": null, // (number_simultaneous_start) "aantal_groepen_tegelijk_starten": null, // (number_of_groups_simultaneous_start) "overzichtmenu": false, // (overview_menu) "percentage_online_te_boeken": 0 // (percentage_online_bookable) }
- JSON Parameters:
id (int) – ID number, may not be changed
naam (string) – Name of the material (naam means name)
aantal (int) – Quantity available of this material (aantal means quantity)
aantal_groepen (int) – Maximum number of bookings over which this material can be distributed (aantal_groepen means number_of_groups)
aantal_tegelijk_starten (int) – Number of this material that can be issued at the same time (aantal_tegelijk_starten means number_simultaneous_start)
aantal_groepen_tegelijk_starten (int) – Number of bookings that can start with this material at the same time (aantal_groepen_tegelijk_starten means number_of_groups_simultaneous_start)
overzichtmenu (boolean) – Whether this material should be shown in the overview menu in Recras (overzichtmenu means overview_menu)
percentage_online_te_boeken (int) – The percentage of this material that may be maximally issued via online bookings (percentage_online_te_boeken means percentage_online_bookable)
- Response Headers:
Location – The location of the new material
- Status Codes:
201 Created – Material created (Materiaal gemaakt)
406 Not Acceptable – Error in the input (Fout in de invoer)
403 Forbidden – User does not have the
editMateriaal
(editMaterial) permission (Gebruiker heeft het recht editMateriaal niet)
Read¶
- GET /api2/materialen¶
The materials in Recras
Example request:
GET /api2/materialen HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "naam": "Fiets", // (name: "Bicycle") "aantal": 25, // (quantity) "aantal_groepen": null, // (number_of_groups) "aantal_tegelijk_starten": null, // (number_simultaneous_start) "aantal_groepen_tegelijk_starten": null, // (number_of_groups_simultaneous_start) "overzichtmenu": false, // (overview_menu) "percentage_online_te_boeken": 0 // (percentage_online_bookable) } ]
- Status Codes:
200 OK – no error
- GET /api2/materialen/(int: id)¶
A specific material
Example request:
GET /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "naam": "Fiets", // (name: "Bicycle") "aantal": 25, // (quantity) "aantal_groepen": null, // (number_of_groups) "aantal_tegelijk_starten": null, // (number_simultaneous_start) "aantal_groepen_tegelijk_starten": null, // (number_of_groups_simultaneous_start) "overzichtmenu": false, // (overview_menu) "percentage_online_te_boeken": 0 // (percentage_online_bookable) }
- Status Codes:
200 OK – OK
404 Not Found – No material with this
id
(Geen materiaal met deze id)
Update¶
- PUT /api2/materialen/(int: id)¶
Example request:
PUT /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "id": 1, "naam": "Fiets", "aantal": 20, "overzichtmenu": true }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "naam": "Fiets", // (name: "Bicycle") "aantal": 20, // (quantity) "aantal_groepen": null, // (number_of_groups) "aantal_tegelijk_starten": null, // (number_simultaneous_start) "aantal_groepen_tegelijk_starten": null, // (number_of_groups_simultaneous_start) "overzichtmenu": true, // (overview_menu) "percentage_online_te_boeken": 0 // (percentage_online_bookable) }
- JSON Parameters:
id (int) – ID number, may not be changed
naam (string) – Name of the material (naam means name)
aantal (int) – Quantity available of this material (aantal means quantity)
aantal_groepen (int) – Maximum number of bookings over which this material can be distributed (aantal_groepen means number_of_groups)
aantal_tegelijk_starten (int) – Number of this material that can be issued at the same time (aantal_tegelijk_starten means number_simultaneous_start)
aantal_groepen_tegelijk_starten (int) – Number of bookings that can start with this material at the same time (aantal_groepen_tegelijk_starten means number_of_groups_simultaneous_start)
overzichtmenu (boolean) – Whether this material should be shown in the overview menu in Recras (overzichtmenu means overview_menu)
percentage_online_te_boeken (int) – The percentage of this material that may be maximally issued via online bookings (percentage_online_te_boeken means percentage_online_bookable)
- Status Codes:
200 OK – Material updated (Materiaal aangepast)
406 Not Acceptable – Error in the input (Fout in de invoer)
403 Forbidden – User does not have the
editMateriaal
(editMaterial) permission (Gebruiker heeft het recht editMateriaal niet)
Delete¶
- DELETE /api2/materialen/(int: id)¶
Example request:
DELETE /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Material deleted (Materiaal verwijderd)
403 Forbidden – User does not have the
editMateriaal
(editMaterial) permission (Gebruiker heeft het recht editMateriaal niet)