REST API
Opening a door
This guide is for integrations that open a door on somebody’s behalf, for example a booking system that offers a remote opening or a front desk tool. The integration acts for a person, and only if that person could open the door themselves.
Before you start
Section titled “Before you start”- The token needs
interaction_requests:write, andinteraction_requests:readto read the result. - The entrance must allow opening through the API. Its
openable_via_apifield says whether it does. - You need the id of the person you act for: an account, a site membership (site staff) or a tenant membership (tenant user).
Open the door
Section titled “Open the door”-
Send
POST /interaction_requestswith the door and the person. Name the door with exactly one ofentrance_idorunit_id; for a unit, sedisto uses the unit’s entrance. Name the person with exactly one ofaccount_id,site_membership_idortenant_membership_id. Asite_membership_idalso confines the request to that membership.{"entrance_id": "5b1d6c2e-3a4f-4e8a-9c1d-0a1b2c3d4e03","tenant_membership_id": "9a0e…","interaction": "unlock"} -
Choose the operation with
interaction:unlock,lock,openorclose. Without it, sedisto usesunlock. -
Read the response. It is the new interaction request with its
idandstate.
sedisto checks the request exactly as it checks a request from the person’s own app: an active rental agreement or membership, inside its access period, inside opening hours, at an entrance that may be opened through the API. The permission lets you act for somebody; it does not let you exceed what they may do.
When it is refused
Section titled “When it is refused”| Status | Meaning |
|---|---|
404 |
The person or the door cannot be found within your integration’s reach. A removed membership, a tenant membership outside its period and a blocked account count as not found. |
422 |
The person exists but has no valid access right at this door right now, or no person was named. |
401 |
The token is missing or invalid. |
403 |
The token lacks interaction_requests:write. |
When the request times out
Section titled “When the request times out”If your POST /interaction_requests gets no answer, for example because the connection dropped, assume that the door may already have opened. Whether it did depends on how far the request got. Do not send the same request again blindly.
- Look for the request first:
GET /interaction_requestsfiltered by the entrance and arequested_atshortly before your attempt, for exampleq[entrance_id_eq]=<id>&q[requested_at_gteq]=<time>. - If you find it, follow its state as below instead of opening again.
- Only if there is none, and the person still wants the door opened, send a new request.
Follow the result
Section titled “Follow the result”A created request is not yet an open door. The hardware reports back, and the request moves from requested to in_progress and then to completed or failed.
- Webhooks: subscribe to
interaction_request.in_progress,interaction_request.completedandinteraction_request.failed. Each carries the requestid,state,interactionand the timestamps. A successful opening also produces anaccess.grantedevent, delivered separately and possibly earlier or later. See Receiving webhooks. - Polling:
GET /interaction_requests/{id}returns the current state withrequested_at,completed_atorfailed_at.
GET /interaction_requests lists all door interactions at the sites your integration may see, newest first. It is the audit trail of openings and grows without bound, so filter it, for example with q[state_eq]=failed. See Filtering, searching and sorting.