Identity

Authenticate with Meshblu

The primary means of identifying a device is by a UUID and a Token. The UUID and Token can be created by meshblu or registered with the device using the register API. When connecting to Meshblu, devices will be authenticated with their UUID and Token.

var ws = new WebSocket("wss://meshblu.octoblu.com/ws/v2");

ws.send(JSON.stringify([
  "identity",
  {
    "uuid":"26de691f-8068-4cdc-907a-4cb5961a1aba",
    "token":"2e924d1a9cad175ba91f120ede720d50010cd966"
  }
]));

❗️

Identity is required

Identity is required as the first step when using the websocket api. You also must wait for the ready message to be emitted. Any messages passed in that require authentication will fail.

📘

Subscribe

Identity will automatically subscribe you to messages received by device.

Success

If you successfully identify you will receive a ready message

[
  "ready",
  {
    "uuid":"26de691f-8068-4cdc-907a-4cb5961a1aba",
    "token":"2e924d1a9cad175ba91f120ede720d50010cd966",
    "status":200
  }
]

Failure

On authentication failure, you will receive a notReady message

[
  "notReady",
  {
    "uuid":"26de691f-8068-4cdc-907a-4cb5961a1aba",
    "token":"2e924d1a9cad175ba91f120ede720d50010cd966",
    "status":402
  }
]