GET https://:subddomain.cobot.me/api/resources

This returns a list of all resources for a space.

Authentication required:
yes, additionally user must be a space member or admin
Scope required
read_resources

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] }]
  }
]
timespans
A comma separated list of timespans when the resource can be booked. Can be booked any time if blank. (feature is hidden by default on the website)
booking_url
Post to this URL to book this resource, see the bookings section.
cancellation period
Members can only edit/delete their bookings up until the given no. of hours before a booking starts
can_book
If false, attempting to book the resource will result in a 403 error. This usually happens when a member tries to book resource that can only be booked by admins.
min/max booking duration
in minutes, only applies to members, admins can book any duration
booking_times

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
To request a different photo size, add a photo_size parameter to the request. Currently supported sizes are:
  • icon: 120x120px
  • default: 800x600px
GET https://:subddomain.cobot.me/api/resources/:id

This returns a single resources.

Authentication required:
yes, additionally user must be a space member or admin
Scope required
read_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.

Authentication required:
yes, additionally user must be a space admin
Scope required
write_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"
}
photo
Photos must be uploaded as Base64 encoded data using a [data URI](https://en.wikipedia.org/wiki/Data_URI_scheme).
booking_times
Booking times must be passed as string in the same format as in the admin UI but are returned as an array of objects.

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.

Authentication required:
yes, additionally user must be a space admin
Scope required
write_resources
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.

Authentication required:
yes, additionally user must be a space admin
Scope required
write_resources
DELETE https://co-up.cobot.me/api/resources/12355

Response:

Status 204, no body.

back to index