Skip to content

Websocket

When the status of the device changes, we will notify you via websocket. That way you can reduce the number of times you call PUT /remoteoperate/status yourself. Currently, we only support events where the lock state changes.

  1. You register for websocket with the OAuth token.
  2. You set up a websocket client base on socket.io.
  3. Use the subscriberID you get in step1 as params to connect to our websocket server.
  4. Listen to data and error events.
  5. Yale Home sends a websocket message to client you registered when the status of lock changes.

NOTE

the x-access-token and x-api-key are always needed in the headers.


When you no longer want or need it, please delete the websocket registration.

Registering websocket#

Use this endpoint to register for websocket about lock related events.

The following example creates a websocket registration.

POST /websocket/subscribers

{
  "subscriberID": "Newly created subscriberID",
  "scopes": ['lock'],
  "clientID": "your_client_id",
  "userID": "name_of_header_you_expect",
}

Deleting websocket registrations#

Delete a websocket registration to stop receiving websocket messages.

DELETE /websocket/subscribers/:subID

Getting websocket registrations#

Get a websocket registration.

GET /websocket/subscribers/:subID

Retries#

Yale Home will only call a websocket once for each event.