GET https://:subddomain.cobot.me/api/resources
This returns a list of all resources for a space.
To only fetch some resources, pass a parameter ids=id1,id2...
.
GET https://co-up.cobot.me/api/resources
Response:
[ { "id": "12355", "name": "Room", "price_per_hour": "10.0", "tax_rate": "10.0", "hidden": false, "capacity": 1, "currency": "EUR", "description": "fits up to 10 people", "cancellation_period": 3, "can_book": true, "color": "#FF0000", "photo": "https://co-up.cobot.me/path/to/default_photo_size.jpg", "min_booking_duration": 0, "max_booking_duration": 120, "booking_url": "https://co-up.cobot.me/api/resources/12345/bookings", "booking_times": [{ "from": "10:00", "to": "17:00", "weekdays": [1, 2] }] } ]
The days/times a resource can be booked. When empty, the resource can be booked at any time.
When weekdays is empty, the returned hours are valid on any day of the week. Otherwise only on those days returned. Weekdays are numbered from 1 (Monday) to 7 (Sunday), according to ISO 8601.
photo_size
parameter to the request. Currently supported sizes are:
GET https://:subddomain.cobot.me/api/resources/:id
This returns a single resources.
GET https://co-up.cobot.me/api/resources/12355
Response:
{ "id": "12355", "name": "Room", "price_per_hour": "10.0", "tax_rate": "10.0", "hidden": false, "capacity": 1, "currency": "EUR", "description": "fits up to 10 people", "cancellation_period": 3, "can_book": true, "color": "#FF0000", "photo": "https://co-up.cobot.me/path/to/default_photo_size.jpg", "min_booking_duration": 0, "max_booking_duration": 120, "booking_url": "https://co-up.cobot.me/api/resources/12345/bookings", "booking_times": [{ "from": "10:00", "to": "17:00" }] }
POST https://:subddomain.cobot.me/api/resources
This creates a resources.
POST https://co-up.cobot.me/api/resources
{ "name": "Meeting Room", "price_per_hour": "10.0", "tax_rate": "10.0", "description": "fits up to 10 people", "cancellation_period": 3, "photo": { "data": "data:image/png;base64,iVBORw0KGgoAAAA…ggg==" }, "booking_times": "mo - fr 9am - 5pm" }
Response:
{ "id": "12355", "name": "Meeting Room", "price_per_hour": "10.0", "tax_rate": "10.0", "hidden": false, "capacity": 1, "currency": "EUR", "description": "fits up to 10 people", "cancellation_period": 3, "can_book": true, "color": "#FF0000", "photo": "https://co-up.cobot.me/path/to/default_photo_size.jpg", "min_booking_duration": 0, "max_booking_duration": 120, "booking_url": "https://co-up.cobot.me/api/resources/12345/bookings", "booking_times": [ { "from": "09:00", "to": "17:00", "weekdays": [1, 2, 3, 4, 5] } ] }
PUT https://:subddomain.cobot.me/api/resources/:id
This updates a resource.
PUT https://co-up.cobot.me/api/resources/12355
{ "name": "Conference Room", "photo": { "data": "data:image/png;base64,iVBORw0KGgoAAAA…ggg==" } }
Response:
{ "id": "12355", "name": "Conference Room", "price_per_hour": "10.0", "tax_rate": "10.0", "hidden": false, "capacity": 1, "currency": "EUR", "description": "fits up to 10 people", "cancellation_period": 3, "can_book": true, "color": "#FF0000", "photo": "https://co-up.cobot.me/path/to/default_photo_size.jpg", "min_booking_duration": 0, "max_booking_duration": 120, "booking_url": "https://co-up.cobot.me/api/resources/12345/bookings", "booking_times": [] }
DELETE https://:subddomain.cobot.me/api/resources/:id
This deletes a resources.
DELETE https://co-up.cobot.me/api/resources/12355
Response:
Status 204, no body.