Skip to main content

3.5 Asynchronous Client Message Format

Asynchronous messages sent from your software to MollyBet API take the form of a JSON list. You may send requests over the WebSocket connection to instruct MollyBet API to send one or more responses in Asynchronous Server Message Format to that message over that particular WebSocket connection.

The messages accepted by the WebSocket are in the form of a list whose first item is the message name and following items are the arguments supported by the command, if any. See Asynchronous Client Message Types for the list of supported messages.

For example to subscribe to offer updates for an event you would send:

["register_event", sport, event_id]
MollyBet API will respond with a response message informing about the success or failure of the command, and may include offer updates about the registered events in the asynchronous stream over the same WebSocket connection it received your client message.