The Melody device can request an OTP directly over its active WebSocket connection to the Haptics server. This is an alternative to the WiFi APIDocumentation Index
Fetch the complete documentation index at: https://docs.getmelody.io/llms.txt
Use this file to discover all available pages before exploring further.
startOtp service command and does not require a separate HTTP call.
Frame Types
| Frame Type | Value | Direction | Protobuf Message |
|---|---|---|---|
OTP_REQUEST | 19 | Device → Server | OTPRequest |
OTP_RESPONSE | 20 | Server → Device | OTPResponse |
Message Definitions
OTPRequest (device → server):Flow
- Device sends an
OTP_REQUESTframe with a serialized (empty)OTPRequestmessage over the existing WebSocket connection. - Server generates the OTP and replies with an
OTP_RESPONSEframe on the same connection. - If generation fails,
erroris non-empty —otpshould be ignored in this case.
Code Example
Notes
- The OTP is scoped to the requesting device’s connection — it is not broadcast to other subscribers.
- Maximum response time is 10 seconds (proxy timeout to the session manager).
- The
startOtpWiFi API service command remains available as an alternative for devices that need OTP without an active WebSocket connection.