POST /cn/:cn/data_stream - Create persistent web socket session to all your devices

Creates websocket session which can be join afterwards. Session will buffer all messages if no open websocket connection currently exists. Once first websocket connection is openened, buffered messages are flushed to websocket

Request Parameters

 

ParameterDataTypeDescription
cnstringcommon name for all your organization devices

Example client request of creating new persistent websocket session

POST /cn/commonnNameOfYourDevices/data_stream HTTP/1.1
ApiKey: xyz
Content-Length: 0
Host: localhost:8443
Connection: Keep-Alive

Example server response containing session_id

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 20 
{"session_id":"4:3"} 

Response Status Codes

Server will return 200 if persistent websocket session was created and can be join later

For error cases see: Error Status Codes

Response Data Parameters

ParameterDatatypeDescription
session_idstringsession identiefiier which can usd to resume previous websocket sessions, if for example connections has been dropped  

Example server response containing session_id

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 20 
{"session_id":"4:3"}