Locations (Locaties) ==================== Current version: 1.0.0 Create ------ .. http:post:: /api2/locaties Create a new location **Example request** .. sourcecode:: http POST /api2/locaties HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "kleine zaal", // (name: "small room") "weergavenaam": "vergaderzaal (tot 15 p.)", // (display_name: "meeting room (up to 15 p.)") "capaciteit": 20, // (capacity) "aantal_groepen": 1 // (number_of_groups) } **Example response** .. sourcecode:: http HTTP/1.1 201 Created Content-Type: application/json Location: /api2/locaties/12 { "id": 12, "naam": "kleine zaal", // (name: "small room") "kleur": null, // (color) "weergavenaam": "vergaderzaal (tot 15 p.)", // (display_name: "meeting room (up to 15 p.)") "adres": null, // (address) "postcode": null, // (postal_code) "plaats": null, // (city) "telefoonnummer": null, // (phone_number) "latitude": null, "longitude": null, "capaciteit": 20, // (capacity) "aantal_groepen": 1, // (number_of_groups) "parent_id": null } :json string naam: **Required** Name of the location (`naam` means name) :json string kleur: Default: ``null`` Color for in day planning (`kleur` means color) :json string weergavenaam: Default: ``null`` Name displayed to customers (`weergavenaam` means display_name) :json string adres: Default: ``null`` Address of the location (`adres` means address) :json string postcode: Default: ``null`` Postal code of the location (`postcode` means postal_code) :json string plaats: Default: ``null`` City of the location (`plaats` means city) :json string telefoonnummer: Default: ``null`` Phone number of the location (`telefoonnummer` means phone_number) :json float latitude: Default: ``null`` GPS latitude of the location (decimal) (`breedtegraad` means latitude) :json float longitude: Default: ``null`` GPS longitude of the location (decimal) (`lengtegraad` means longitude) :json integer capaciteit: Default: ``null`` Maximum number of people that can be present at the same time (`capaciteit` means capacity) :json integer aantal_groepen: Default: ``null`` Maximum number of bookings that can take place simultaneously (`aantal_groepen` means number_of_groups) :json integer parent_id: Default: ``null`` The ``id`` of the location of which this location is a part :resheader Location: The http location of the new location :statuscode 201: Location created (`Locatie gemaakt`) :statuscode 406: Error in the input (`Fout in de invoer`) :statuscode 403: User does not have the ``editLocaties`` (editLocations) permission (`Gebruiker heeft het recht editLocaties niet`) Read ---- .. http:get:: /api2/locaties List of locations in Recras **Example request**: .. sourcecode:: http GET /api2/locaties HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json [ { "id": 5, "naam": "Paintball", // (name) "kleur": "#e6ead1", // (color) "weergavenaam": "Paintball", // (display_name) "adres": "", // (address) "postcode": "", // (postal_code) "plaats": "", // (city) "telefoonnummer": "", // (phone_number) "latitude": null, "longitude": null, "capaciteit": 40, // (capacity) "aantal_groepen": 2, // (number_of_groups) "parent_id": null }, { "id": 9, "naam": "Paintball \"het Bos\"", // (name: "Paintball \"the Forest\"") "kleur": "#23d421", // (color) "weergavenaam": "Paintball \"het Bos\"", // (display_name: "Paintball \"the Forest\"") "adres": "", // (address) "postcode": "", // (postal_code) "plaats": "", // (city) "telefoonnummer": "", // (phone_number) "latitude": null, "longitude": null, "capaciteit": 15, // (capacity) "aantal_groepen": 1, // (number_of_groups) "parent_id": 5 } ] :query treeContains: A comma-separated list of location IDs, returns all locations that contain one of the specified IDs in the tree structure. :query embedGebruikOpDatum: A date for which the usage information (how many people and groups are present from moment to moment) should be displayed (`embedGebruikOpDatum` means embedUsageOnDate). :statuscode 200: OK .. http:get:: /api2/locaties/(int:id) A specific payment method (This seems to be a copy-paste error from betaalmethoden.rst, should be "A specific location") :query embedGebruikOpDatum: A date for which the usage information (how many people and groups are present from moment to moment) should be displayed (`embedGebruikOpDatum` means embedUsageOnDate). :statuscode 200: OK :statuscode 404: Geen locatie met deze ``id`` Update ------ .. http:put:: /api2/locaties/(int:id) Zie :http:post:`/api2/locaties` Delete ------ .. http:delete:: /api2/locaties/(int:id) **Example request**: .. sourcecode:: http DELETE /api2/locaties/1 HTTP/1.1 Host: demo.recras.nl **Example response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Location deleted (`Locatie verwijderd`) :statuscode 403: User does not have the ``editLocaties`` (editLocations) permission (`Gebruiker heeft het recht editLocaties niet`)