Reservations

Reservations is being replaced by Group Reservations which gives a wider range of features.

The model is a little different, but by ensuring that Groups are appropriately populated for a period of time, Role based permissions are inherited to facilitate access for this period of time.

Reservations enable a person to access a door temporarily. Internally DoorFlow manages the creation of temporary shift(s) and role(s) which are cleared once the reservation ends.

A reservation grants an individual person access to one or more specific doors for a brief duration, must be less than 24 hours. This is likely a temporary access pass, which could be used for visitors, contractors, or temporary staff needing short-term entry to certain areas. If you would like give temporary access for a longer period then please look to Group Reservations.


Listing all reservations

Scopes required : account.person or account.person.readonly

Returns a list of all future or current reservations in your account.

GET /api/3/reservations

Example Response

[
  {
    "id": 7,
    "person_id": 123,
    "start_time": "2016-08-12T13:00:00+01:00",
    "end_time": "2016-08-12T14:00:00+01:00",
    "created_at": "2016-08-02T08:41:19+01:00",
    "updated_at": "2016-08-02T08:41:19+01:00",
    "channel_ids": [
      1340,
      1342
    ]
  },
  {
    "id": 6,
    "person_id": 123,
    "start_time": "2016-08-09T13:00:00+01:00",
    "end_time": "2016-08-09T14:00:00+01:00",
    "created_at": "2016-08-02T08:41:18+01:00",
    "updated_at": "2016-08-02T08:41:18+01:00",
    "channel_ids": [
      1341
    ]
  }
]

Remember that this endpoint might be paginated


Create a reservation

Scopes required : account.person

POST /api/3/reservations

You can create a reservation for any time in the future. A single reservation can last for any duration from 1 minute to 24 hours. The reservation should start and finish within the same day (ending no later than midnight).

You might want to span access to the door overnight too, and in this instance, you might choose to create multiple reservations - one for each day.

Once you've created your reservations, remember to call Sync to promote your changes to the doors.

Attribute Data type Notes
channel_ids integer (array) REQUIRED
person_id integer REQUIRED
start_time timestamp REQUIRED
end_time timestamp REQUIRED

Example Payload

{
  "channel_ids": [1340,1342],
  "person_id": 123,
  "start_time": "2016-08-09 13:00:00",
  "end_time": "2016-08-09 14:00:00"    
}

Example Response

{
    "id": 7,
    "person_id": 123,
    "start_time": "2016-08-12T13:00:00+01:00",
    "end_time": "2016-08-12T14:00:00+01:00",
    "created_at": "2016-08-02T08:41:19+01:00",
    "updated_at": "2016-08-02T08:41:19+01:00",
    "channel_ids": [
      1340,
      1342
    ]
 }

Delete a reservation

Scopes required : account.person

Example Request

DELETE /api/3/reservations/:id

This will delete the reservation and the related temporary shift and role.

Example Response

{ result: "ok" }