Listening in to device communication

Get a Websocket to listen to messages from and to a single device. In the HTTP request, the client shoud upgrade to a WebSocket connectionopen in new window.

GET https://api.teleport.withthegrid.com/v1/device/web-socket/
query string
{
deviceHashId: string;
}
RESPONSE
successful responses
101
An open websocket
error responses (next to generic errors)
400 { key: "unknown_device_hash_id" }
Device hashId is unknown.

400 { key: "upgrade_failed" }
Server did not receive a request to upgrade to websocket.

Please note that cURL does not support websockets. To connect, you can use a tool like wscatopen in new window:

wscat -c "wss://api.teleport.withthegrid.com/v1/device/web-socket?deviceHashId=supplyHashIdHere" -H "authorization:Bearer enteryourtokenhere"