Skip to content

Websocket

Description

The second iteration of the websocket module.

WARNING

When using both the websocket module version one and version two make sure to first add the version two to the module stack and then version one! This is required in order to ensure that users who do already use the second version can reach the required endpoints without the other module interfering.

To see all possible events head over to each modules event section if available. If there is not event section, then there is no event sent over the websocket.

INFO

Most events require at least the read access for each modules resource. There might be more filtering based on device and service identifiers depending on the access of your account.

API

Get Ticket

Due to the fact that some websocket libraries do not support authorization header in the upgrade request, such as most browsers, this endpoint was created to associate a ticket with your token. The ticket ist active for thirty seconds and after its generation the endpoint /events/-TICKET- is available to start a websocket connection.

GET
/api/v1/events/ticket

Response

NameDescription
ticket
string
A secret that can be used to by pass the need for an authorization header in the upgrade request that some browser or websocket libraries do not support.

Create Websocket with Ticket

Starts a websocket connection with a previously generated ticket. The ticket will be matched to the users account.

GET
/api/v1/events/:ticket

URL Parameter

NameDescription
ticket
string
The ticket returned by the `/event/ticket` endpoint.

Response

This endpoint simply returns Status 204 to indicate a successful operation and to save bandwidth.

Create Websocket

Starts a websocket connection. Expects the token for the client as a header.

GET
/api/v1/events

Response

This endpoint simply returns Status 204 to indicate a successful operation and to save bandwidth.