GET /cn/:cn/data_stream - Use non persistent web socket to all your devices
Opens WebSocket to Kaltiot Smart Cloud. Kaltiot Smart Gateway SDK will push data from IoT Device to this WebSocket when there are new data available at IoT Device. Data comes as array of JSON objects. Websocket session is not persistent, meaning when there is no websocket connection, data from device is not buffered. If you want data to be buffered, create websocket session first using Http POST.
Request Parameters
Parameter | DataType | Description |
---|---|---|
cn | string | Common Name, Identifier which is common for all your device |
Response Status Codes
Server will return 101 http code if WebSocket connection was accepted by server
For error cases see: Error Status Codes
Response Data Parameters
Parameter | Datatype | Description |
---|---|---|
rid | string | Unique identifier to your device |
timestamp | number | time in milliseconds from Jan 1970 UTC |
payload_type | string | enumeration data type for the payload. Possible values: STRING, INT, BINARY |
payload | depends on payload_type parameter | This is data object which IoT devices publishes. Can be everything as long as it comforts JSON standard |