Materials (Materialen) ====================== Current version: 1.0.0 Create ------ .. http:post:: /api2/materialen Create a new material **Example request**: .. sourcecode:: http POST /api2/materialen HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "Fiets", } **Example response**: .. sourcecode:: http 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 int id: ID number, may not be changed :json string naam: Name of the material (`naam` means name) :json int aantal: Quantity available of this material (`aantal` means quantity) :json int aantal_groepen: Maximum number of bookings over which this material can be distributed (`aantal_groepen` means number_of_groups) :json int aantal_tegelijk_starten: Number of this material that can be issued at the same time (`aantal_tegelijk_starten` means number_simultaneous_start) :json int aantal_groepen_tegelijk_starten: Number of bookings that can start with this material at the same time (`aantal_groepen_tegelijk_starten` means number_of_groups_simultaneous_start) :json boolean overzichtmenu: Whether this material should be shown in the overview menu in Recras (`overzichtmenu` means overview_menu) :json int percentage_online_te_boeken: The percentage of this material that may be maximally issued via online bookings (`percentage_online_te_boeken` means percentage_online_bookable) :resheader Location: The location of the new material :statuscode 201: Material created (`Materiaal gemaakt`) :statuscode 406: Error in the input (`Fout in de invoer`) :statuscode 403: User does not have the ``editMateriaal`` (editMaterial) permission (`Gebruiker heeft het recht editMateriaal niet`) Read ---- .. http:get:: /api2/materialen The materials in Recras **Example request**: .. sourcecode:: http GET /api2/materialen HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http 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) } ] :statuscode 200: no error .. http:get:: /api2/materialen/(int:id) A specific material **Example request**: .. sourcecode:: http GET /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http 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) } :statuscode 200: OK :statuscode 404: No material with this ``id`` (`Geen materiaal met deze id`) Update ------ .. http:put:: /api2/materialen/(int:id) **Example request**: .. sourcecode:: http PUT /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "id": 1, "naam": "Fiets", "aantal": 20, "overzichtmenu": true } **Example response**: .. sourcecode:: http 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 int id: ID number, may not be changed :json string naam: Name of the material (`naam` means name) :json int aantal: Quantity available of this material (`aantal` means quantity) :json int aantal_groepen: Maximum number of bookings over which this material can be distributed (`aantal_groepen` means number_of_groups) :json int aantal_tegelijk_starten: Number of this material that can be issued at the same time (`aantal_tegelijk_starten` means number_simultaneous_start) :json int aantal_groepen_tegelijk_starten: Number of bookings that can start with this material at the same time (`aantal_groepen_tegelijk_starten` means number_of_groups_simultaneous_start) :json boolean overzichtmenu: Whether this material should be shown in the overview menu in Recras (`overzichtmenu` means overview_menu) :json int percentage_online_te_boeken: The percentage of this material that may be maximally issued via online bookings (`percentage_online_te_boeken` means percentage_online_bookable) :statuscode 200: Material updated (`Materiaal aangepast`) :statuscode 406: Error in the input (`Fout in de invoer`) :statuscode 403: User does not have the ``editMateriaal`` (editMaterial) permission (`Gebruiker heeft het recht editMateriaal niet`) Delete ------ .. http:delete:: /api2/materialen/(int:id) **Example request**: .. sourcecode:: http DELETE /api2/materialen/1 HTTP/1.1 Host: demo.recras.nl **Example response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Material deleted (`Materiaal verwijderd`) :statuscode 403: User does not have the ``editMateriaal`` (editMaterial) permission (`Gebruiker heeft het recht editMateriaal niet`)