Attributes
| Name | Type | Description |
|---|---|---|
| id | Integer | Automatically set |
| created_at | Datetime | Automatically set |
| updated_at | Datetime | Automatically set |
| title | String | Required |
| active | Boolean | Automatically set |
| capacity | Integer | |
| custom_data | Array | Not required |
| opening_hours_mon | Array | Default opening hours for Monday. |
| opening_hours_tue | Array | Default opening hours for Tuesday. |
| opening_hours_wed | Array | Default opening hours for Wednesday. |
| opening_hours_thu | Array | Default opening hours for Thursday. |
| opening_hours_fri | Array | Default opening hours for Friday. |
| opening_hours_sat | Array | Default opening hours for Saturday. |
| opening_hours_sun | Array | Default opening hours for Sunday. |
Default opening hours
Values for the opening hours attributes is of type time in the array. Values are in the form of two’s. This results in adding breaks within a day. To define opening hours from 8AM to 4PM with lunch at 12PM to 12.30PM the following array will be the result: ['08:00', '12:00', '12:30', '16:00']. Having opening hours without a lunch break will yield this result: ['08:00', '16:00']. To define a weekday as closed the value should be null.
Deprecated Attributes
| Name | Type | Description |
|---|---|---|
| open_0 | Time | Opening time for Monday |
| open_1 | Time | Opening time for Tuesday |
| open_2 | Time | Opening time for Wednesday |
| open_3 | Time | Opening time for Thursday |
| open_4 | Time | Opening time for Friday |
| open_5 | Time | Opening time for Saturday |
| open_6 | Time | Opening time for Sunday |
| close_0 | Time | Closing time for Monday |
| close_1 | Time | Closing time for Tuesday |
| close_2 | Time | Closing time for Wednesday |
| close_3 | Time | Closing time for Thursday |
| close_4 | Time | Closing time for Friday |
| close_5 | Time | Closing time for Saturday |
| close_6 | Time | Closing time for Sunday |
These deprecated attributes define opening hours without breaks. Given opening_hours_tue with a break defined as this: ['08:00', '12:00', '12:30', '16:00'] it would yield open_1 to be 08:00 and close_1 to be 16:00. These attributes are deprecated and will be removed in a future API version.
Listing
GET /resources will return all resources.
Response
[
{
"resource": {
"capacity": 1,
"created_at": "2012-09-20T15:34:16+02:00",
"id": 1,
"opening_hours_mon": ["08:00", "16:00"],
"opening_hours_tue": ["08:00", "11:00", "13:00", "17:30"],
"opening_hours_wed": ["08:00", "16:00"],
"opening_hours_thu": ["08:00", "12:00", "14:00", "20:00"],
"opening_hours_fri": ["08:00", "12:00", "12:30", "17:30"],
"opening_hours_sat": null,
"opening_hours_sun": null,
"title": "Mr. Spine Twister",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
Get resource
GET /resources/{resource_id} will get a resource with id {resource_id}.
Add new resource
POST /resources will create a new resource.
Update resource
PUT /resources/{resource_id} will update existing resource with id {resource_id}.
Delete resource
DELETE /resources/{resource_id} will delete existing resource with id {resource_id}. Deleting a resource will set it to active=false and will not be returned in any listings.
Get opening hours for all resources
GET /resources/opening_hours will return opening hours for all resources on specific dates.
Query Parameters
| Name | Type | Description |
|---|---|---|
| from | Date | Default: today |
| to | Date | Default: today |
Get opening hours for specific dates
Opening hours for specific dates is based on the standard opening hours that are specified on the resource but can be overridden with entries in resource exception dates.
Listing
GET /resources/{resource_id}/opening_hours will get opening hours on specific dates for resource with id {resource_id}.
Response
[
{
"resource_opening_hours": {
"date": "2015-12-03",
"opening_hours": ["10:00", "12:00"]
}
},
{
"resource_opening_hours": {
"date": "2015-12-04",
"opening_hours": null
}
}
]
Query Parameters
| Name | Type | Description |
|---|---|---|
| from | Date | Default: today |
| to | Date | Default: today |