Skip to main content

5.1 Messages

5.1.1 register_event: register to receive updates for an event

Register to an event with primary key (sport, event_id).

A client will typically register to one or more events, as described in General Workflow, and start receiving asynchronous update messages with respect to those events.

Fields:

sport [ string ]

The sport of the event.

event_id [ string ]

The opaque ID of the event.

Example:

["register_event", "fb", "2016-06-17,417,6228"]

5.1.2 unregister_event: stop receiving updates for an event

Unregisters from an event with primary key (sport, event_id).

When a client unregisters, it stops receiving further update messages with respect that event.

Fields:

sport [ string ]

The sport of the event.

event_id [ string ]

The opaque ID of the event.

Example:

["unregister_event", "fb", "2016-06-17,417,6228"]

5.1.3 list_registered_events: list all registered events

List all the events a client is registered to.

Example:

["list_registered_events"]

5.1.4 echo: test connection by echoing back data

The echo command is used to allow the client to send ping/pong requests to the server, to test the connection. Normally, websocket client libraries should provide access to the base WebSocket protocol PING and PONG messages, but in case the client library has no such API (e.g. web browsers), this command provides a useful alternative.

Fields:

Any fields provided, in addition to the command name, itself will be included in the command response.

Example:

> ["echo", 123, "abc"]
< {"ts":1526909238.0,"data":[["response",{"status":"ok","data":[123,"abc"]}]]}