GET https://:subdomain.cobot.me/api/bookings
This returns a list of all bookings for a space overlapping the given time period.
GET https://co-up.cobot.me/api/bookings?from=2012-04-12 12:00 +0000&to=2012-04-18 18:00 +0000
Response:
[ { "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "event booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": false, "event": { "id": "event-id" }, "comments": "coffee please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/resources/:resource_id/bookings
This returns a list of all bookings for a space and a resource overlapping the given time period.
GET https://co-up.cobot.me/api/resources/12345/bookings?from=2012-04-12 12:00 +0000&to=2012-04-18 18:00 +0000
Response:
[ { "id": "d58b612aaa62619aae546dd336587eb2", "from": "2012/04/12 12:00:00 +0000", "to": "2012/04/12 18:00:00 +0000", "tax_rate": "20.0", "title": "event booking", "resource": { "name": "Meeting Room", "id": "12345" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": false, "comments": "coffee please", "event": { "id": "event-id" }, "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/membership/bookings
This returns a list of all bookings for a space and a membership overlapping the given time period.
GET https://co-up.cobot.me/api/memberships/bookings?from=2012-04-12 12:00 +0000&to=2012-04-18 18:00 +0000
Response:
[ { "id": "d58b612aaa62619aae546dd336587eb2", "from": "2012/04/12 12:00:00 +0000", "to": "2012/04/12 18:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "12345" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": true, "comments": "coffee please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/memberships/:membership_id/bookings
This returns a list of all bookings for a space and a membership overlapping the given time period.
GET https://co-up.cobot.me/api/memberships/123498y452346/bookings?from=2012-04-12 12:00 +0000&to=2012-04-18 18:00 +0000
Response:
[ { "id": "d58b612aaa62619aae546dd336587eb2", "from": "2012/04/12 12:00:00 +0000", "to": "2012/04/12 18:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "12345" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": true, "comments": "coffee please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/membership/bookings/recent
This returns a list of not yet invoiced bookings for a member (does not include free bookings).
GET https://co-up.cobot.me/api/membership/bookings/recent
Response:
[ { "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": false, "comments": "tea please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/membership/bookings/upcoming
This returns a list of upcoming bookings for a member.
GET https://co-up.cobot.me/api/membership/bookings/upcoming
Response:
[ { "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": true, "comments": "tea please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" } ]
GET https://:subdomain.cobot.me/api/bookings/:booking_id
This returns a single booking.
GET https://co-up.cobot.me/api/bookings/20723075
Response:
{ "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": true, "comments": "tea please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" }
POST https://:subdomain.cobot.me/api/resources/:resource_id/bookings
This books a resource. Obtain the URL from the list of resources (see resources section).
POST https://co-up.cobot.me/api/resources/230847/bookings
Body:
{ "from": "2012-01-01 12:00 +0000", "to": "2012-01-01 14:00 +0000", "title": "test booking", "membership_id": "123498y452346", "comments": "tea please", "units": 1, "has_custom_price": false }
Response:
{ "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": null, "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/20723075", "id": "20723075", "can_change": true, "comments": "tea please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" }
Returns 201 and the booking as JSON on success. Returns 422 and the errors as JSON if the booking was invalid.
PUT https://:subdomain.cobot.me/api/bookings/:booking_id
This updates a booking. Obtain the URL from the list of bookings or when creating the booking.
URL: PUT https://co-up.cobot.me/bookings/23048762375
Body:
{ "from": "2012-01-1 12:00 +0000", "to": "2012-01-01 14:00 +0000", "title": "test booking", "membership_id": "123498y452346", "resource_id": "12345", "comments": "tea please", "units": 1 }
Response:
{ "from": "2012/01/01 12:00:00 +0000", "to": "2012/01/01 14:00:00 +0000", "tax_rate": "20.0", "title": "test booking", "resource": { "name": "Meeting Room", "id": "123" }, "price": 10.0, "has_custom_price": false, "currency": "EUR", "accounting_code": "B1", "membership": { "id": "123498y452346", "name": "John Doe" }, "url": "https://co-up.cobot.me/api/bookings/23048762375", "id": "20723075", "can_change": true, "comments": "tea please", "units": 1, "created_at": "2012/01/01 10:00:00 +0000", "updated_at": "2012/01/01 10:30:00 +0000" }
Returns 200 and the booking as JSON on success. Returns 422 and the errors as JSON if the booking was invalid. Returns 409 if the booking has been made by an event and can't be changed through this endpoint.
DELETE https://:subdomain.cobot.me/api/bookings/32947346
This deletes a booking. The URL of a booking can be obtained either from the response when creating it or from listing all bookings.
DELETE https://co-up.cobot.me/api/bookings/32947346
Returns an empty 204 response. Returns 409 if the booking has been made by an event and can't be delete through this endpoint.