flowthings.io Websocket API authentication


Setup


POST https://ws.flowthings.io/session

Create a new session. The returned session id can then be used to make a WebSocket connection.

Headers

NameDescription
X-Auth-AccountYour flowthings.io username
X-Auth-TokenAuthentication Token

The Authentication Token is either your Master Token or a user-generated Token

Response:

{
  "head": {
    "ok": true,
    "status": 201,
    "errors": []
  },
  "body": {
    "id": "<session_id>"
  }
}

GET wss://ws.flowthings.io/session/<session_id>/ws

Opens a bidirectional WebSocket connection.

GET wss://ws.flowthings.io/session/<session_id>/streaming

Opens a long-lived connection that will stream messages in chunks.

GET wss://ws.flowthings.io/session/<session_id>/polling

Opens a long-polling connection that will close when a message is received. The session will be suspended and messages queued for a short window of time. The client should then reconnect, resuming the session. If any messages were queued, they will immediately be sent to the client. If the client does not connect within the grace period, the session will be closed.

Responds with a JSON array of messages.

Messages


See the following pages for message formats by type: