1. Obtain an authentication token
This page describes the flow a device performs, not an application. The credential below, the
device token, is issued to the device itself: firmware exchanges the system token it received
during factory activation for one at
POST /api/haptics/device/device_token. If you are building an
application that controls a device, you do not handle it — use the session token and X-Device-Key
described in Organization access.Authorization
header, and the subscription is resolved from that token.
401.
The response contains the WebSocket endpoint and a token to connect with:
ws_proxy_endpoint is deprecated — use ws_endpoint.2. Connect and authenticate
Connect to the Melody server over WebSocket and send a HapticFrame carrying a ProtobufAuth message.
Open the connection:
3. Receive signals
Read frames from the stream and dispatch on the frame type. Always echoTIME_SYNC frames back so the server can measure round-trip latency.