Skip to main content
The WebSocket V2 Send command (Command Type: 3) sends a message over the active WebSocket V2 connection. Typically used inside onConnect or onInterval hooks of the WebSocket V2 command.

Command Type

Command Type ID: 3

Parameters

ParameterTypeDescriptionRequired
sendMessagestringThe message payload to send over the socketYes

Usage Examples

Send Subscription Message on Connect

Used inside the onConnect hook of a WebSocket V2 command:
{
  "id": 3,
  "type": "WS_V2",
  "params": {
    "sendMessage": "{\"action\":\"subscribe\",\"channel\":\"live_odds\"}"
  }
}

Send Periodic Heartbeat

Used inside an onInterval hook:
{
  "id": 3,
  "type": "WS_V2",
  "params": {
    "sendMessage": "{\"type\":\"heartbeat\"}"
  }
}