Products-Availability (Producten-Beschikbaarheid)¶
Current version: 1.0.0
Read¶
- GET /api2/producten/(int: product_id)/beschikbaarheid¶
Get a list of start times (startmomenten) and availabilities (beschikbaarheden) per possible location for the product with id product_id. Only available for products with the setting mag_api = true (may_use_api = true).
- Query Parameters:
eind (date) – Required an ISO8601 date indicating the end (eind) of the date range. The specified date is inclusive.
begin (date) – Default: _today_ (vandaag) an ISO8601 date indicating the start (begin) of the desired date range. The specified date is exclusive.
cache (boolean) – Options: force_on, force_off. Default: force_on. Override the default setting for usage cache in Recras.
- Status Codes:
200 OK – OK
400 Bad Request – Error in parameters (Fout in de parameters)
- Header Link:
When a partial result is returned, a Link header with link-relation next is present. This contains a URI pointing to the next (partial) result. It is possible that the next partial result contains some results that were already returned.
Example request:
GET /api2/producten/7/beschikbaarheid?begin=2037-04-01&eind=2037-04-02 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "startmoment":"2037-04-01T16:00:00+02:00", // (start_time) "locaties":[ // (locations) { "locatie_id":null, // (location_id) "beschikbaarheid":99999 // (availability) }, { "locatie_id":1, // (location_id) "beschikbaarheid":16 // (availability) }, { "locatie_id":2, // (location_id) "beschikbaarheid":99999 // (availability) }, { "locatie_id":3, // (location_id) "beschikbaarheid":99999 // (availability) } ] }, { "startmoment":"2037-04-01T17:00:00+02:00", // (start_time) "locaties":[ // (locations) { "locatie_id":null, // (location_id) "beschikbaarheid":99999 // (availability) }, { "locatie_id":1, // (location_id) "beschikbaarheid":16 // (availability) }, { "locatie_id":2, // (location_id) "beschikbaarheid":99999 // (availability) }, { "locatie_id":3, // (location_id) "beschikbaarheid":99999 // (availability) } ] } ]
- JSON Parameters:
startmoment (string) – ISO8601 start time (startmoment) of product
locaties (array) – List of locations (locaties) where the product can take place with corresponding availability (beschikbaarheid)
locaties.locatie_id (int) – id of location (locatie_id), null is also added if this product can also be booked without a location
locaties.beschikbaarheid (int) – The availability (beschikbaarheid) of the product at this start time and location. 99999 is used as a value for unlimited capacity.