Skip to content

Latest commit

 

History

History
140 lines (109 loc) · 5.36 KB

File metadata and controls

140 lines (109 loc) · 5.36 KB
title Resources
nav_order 6

Attributes

NameTypeDescription
idIntegerAutomatically set
created_atDatetimeAutomatically set
updated_atDatetimeAutomatically set
titleStringRequired
activeBooleanAutomatically set
capacityInteger
custom_dataArrayNot required
opening_hours_monArrayDefault opening hours for Monday.
opening_hours_tueArrayDefault opening hours for Tuesday.
opening_hours_wedArrayDefault opening hours for Wednesday.
opening_hours_thuArrayDefault opening hours for Thursday.
opening_hours_friArrayDefault opening hours for Friday.
opening_hours_satArrayDefault opening hours for Saturday.
opening_hours_sunArrayDefault 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

NameTypeDescription
open_0TimeOpening time for Monday
open_1TimeOpening time for Tuesday
open_2TimeOpening time for Wednesday
open_3TimeOpening time for Thursday
open_4TimeOpening time for Friday
open_5TimeOpening time for Saturday
open_6TimeOpening time for Sunday
close_0TimeClosing time for Monday
close_1TimeClosing time for Tuesday
close_2TimeClosing time for Wednesday
close_3TimeClosing time for Thursday
close_4TimeClosing time for Friday
close_5TimeClosing time for Saturday
close_6TimeClosing 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

NameTypeDescription
fromDateDefault: today
toDateDefault: 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

NameTypeDescription
fromDateDefault: today
toDateDefault: today