Locations (Locaties)¶
Current version: 1.0.0
Create¶
- POST /api2/locaties¶
Create a new location
Example request
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
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 Parameters:
naam (string) – Required Name of the location (naam means name)
kleur (string) – Default:
null
Color for in day planning (kleur means color)weergavenaam (string) – Default:
null
Name displayed to customers (weergavenaam means display_name)adres (string) – Default:
null
Address of the location (adres means address)postcode (string) – Default:
null
Postal code of the location (postcode means postal_code)plaats (string) – Default:
null
City of the location (plaats means city)telefoonnummer (string) – Default:
null
Phone number of the location (telefoonnummer means phone_number)latitude (float) – Default:
null
GPS latitude of the location (decimal) (breedtegraad means latitude)longitude (float) – Default:
null
GPS longitude of the location (decimal) (lengtegraad means longitude)capaciteit (integer) – Default:
null
Maximum number of people that can be present at the same time (capaciteit means capacity)aantal_groepen (integer) – Default:
null
Maximum number of bookings that can take place simultaneously (aantal_groepen means number_of_groups)parent_id (integer) – Default:
null
Theid
of the location of which this location is a part
- Response Headers:
Location – The http location of the new location
- Status Codes:
201 Created – Location created (Locatie gemaakt)
406 Not Acceptable – Error in the input (Fout in de invoer)
403 Forbidden – User does not have the
editLocaties
(editLocations) permission (Gebruiker heeft het recht editLocaties niet)
Read¶
- GET /api2/locaties¶
List of locations in Recras
Example request:
GET /api2/locaties HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
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 Parameters:
treeContains – A comma-separated list of location IDs, returns all locations that contain one of the specified IDs in the tree structure.
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).
- Status Codes:
200 OK – OK
- 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 Parameters:
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).
- Status Codes:
200 OK – OK
404 Not Found – Geen locatie met deze
id
Update¶
- PUT /api2/locaties/(int: id)¶
Delete¶
- DELETE /api2/locaties/(int: id)¶
Example request:
DELETE /api2/locaties/1 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Location deleted (Locatie verwijderd)
403 Forbidden – User does not have the
editLocaties
(editLocations) permission (Gebruiker heeft het recht editLocaties niet)