{"__v":5,"_id":"5564f44d1fd04c0d00dc9abc","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"Establish a websocket connection to Meshblu at [wss://meshblu.octoblu.com/ws/v2](wss://meshblu.octoblu.com/ws/v2).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var ws = new WebSocket(\\\"wss://meshblu.octoblu.com/ws/v2\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nAll messages are simple JSON frames: ```[type, data, ...]```\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\\"subscribe\\\",{\\\"uuid\\\":\\\"26de691f-8068-4cdc-907a-4cb5961a1aba\\\"}]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"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. See the [identity documentation](/v2.0/docs/identity) for more details.\",\n  \"title\": \"Identity is required\"\n}\n[/block]","category":"5564f44d1fd04c0d00dc9abb","createdAt":"2015-05-26T22:27:23.859Z","excerpt":"This page will help you get started with Meshblu Websocket. You'll be up and running in a jiffy!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5564f3491fd04c0d00dc9ab2","slug":"getting-started","sync_unique":"","title":"Getting Started","type":"basic","updates":[],"user":"5564f227f0f70f0d00a9ab20","version":"5564f44c1fd04c0d00dc9aba","childrenPages":[]}

Getting Started

This page will help you get started with Meshblu Websocket. You'll be up and running in a jiffy!

Establish a websocket connection to Meshblu at [wss://meshblu.octoblu.com/ws/v2](wss://meshblu.octoblu.com/ws/v2). [block:code] { "codes": [ { "code": "var ws = new WebSocket(\"wss://meshblu.octoblu.com/ws/v2\");", "language": "javascript" } ] } [/block] All messages are simple JSON frames: ```[type, data, ...]``` [block:code] { "codes": [ { "code": "[\"subscribe\",{\"uuid\":\"26de691f-8068-4cdc-907a-4cb5961a1aba\"}]", "language": "json" } ] } [/block] [block:callout] { "type": "danger", "body": "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. See the [identity documentation](/v2.0/docs/identity) for more details.", "title": "Identity is required" } [/block]