GET /rids/:rid/data_stream - Use non persistent web socket to single device

Opens WebSocket to Kaltiot Smart Cloud. Kaltiot Smart Cloud 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

Request Parameters

ParameterDataTypeDescription
ridstringResource Identifier

Example client request of establishing websocket connection

GET /rids/example_rid/data_stream?ApiKey=example_apikey HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Origin: http://127.0.0.1:8080
Sec-WebSocket-Key: KzJwcJDCSruzORfG59fR9g==
Sec-WebSocket-Version: 13
Host: 127.0.0.1:8080
Accept: */*
User-Agent: AHC/1.0
Content-Length: 0

Example server response for establishing websocket connection

HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Accept: yTLy8kTvOiexc2/CyyJqLGJbd7I=

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

ParameterDatatypeDescription
ridstringresource identifier
timestampnumbertime in milliseconds from Jan 1970 UTC
payload_typestringenumeration data type for the payload. Possible values: STRING, INT, BINARY
payloaddepends on payload_type parameterThis is data object which IoT devices publishes. Can be everything as long as it comforts JSON standard

Example response

[{"rid":"example_rid","timestamp":"1424427183946","payload_type": "INT",payload: 1}]