Table of Contents |
---|
This Heartbeat operation is provided to allow customers to automatically cancel their unmatched bets in the event of their API client/s losing connectivity with the Betfair API.
UK & International Exchange
Interface | Endpoint | <method> Example |
---|---|---|
JSON-RPC | HeartbeatAPING/v1.0/heartbeat |
Italian Exchange
Interface | Endpoint | <method> Example |
---|---|---|
JSON-RPC | HeartbeatAPING/v1.0/heartbeat |
Spanish Exchange
Interface | Endpoint | <method> Example |
---|---|---|
JSON-RPC | HeartbeatAPING/v1.0/heartbeat |
Operation Summary
Detailed documentation
Heartbeat
Operations
Anchor | ||||
---|---|---|---|---|
|
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
2687301Heartbeat API#HeartbeatReport heartbeat ( int preferredTimeoutSeconds ) throws 2687301Heartbeat API#APINGException This heartbeat operation is provided to help customers have their positions managed automatically in the event of their API clients losing connectivity with the Betfair API. If a heartbeat request is not received within a prescribed time period, then Betfair will attempt to cancel all 'LIMIT' type bets for the given customer on the given exchange. There is no guarantee that this service will result in all bets being cancelled as there are a number of circumstances where bets are unable to be cancelled. Manual intervention is strongly advised in the event of a loss of connectivity to ensure that positions are correctly managed. If this service becomes unavailable for any reason, then your heartbeat will be unregistered automatically to avoid bets being inadvertently cancelled upon resumption of service. you should manage your position manually until the service is resumed. Heartbeat data may also be lost in the unlikely event of nodes failing within the cluster, which may result in your position not being managed until a subsequent heartbeat request is received.
|
Anchor | ||||
---|---|---|---|---|
|
This interface does not define any events.
...
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
Response from heartbeat operation
|
Enums
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Exceptions
Anchor | ||||
---|---|---|---|---|
|
...
Panel | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
This exception is thrown when an operation fails
|
Typical Interaction
...
Setting Up Heartbeat
Code Block |
---|
[{"jsonrpc": "2.0", "method": "HeartbeatAPING/v1.0/heartbeat", "params": {"preferredTimeoutSeconds":"10"}, "id": 1}] [{"jsonrpc":"2.0","result":{"actualTimeoutSeconds":10,"actionPerformed":"NONE"},"id":1}] |
Resetting Heartbeat
Code Block | ||
---|---|---|
| ||
[{"jsonrpc": "2.0", "method": "HeartbeatAPING/v1.0/heartbeat", "params": {"preferredTimeoutSeconds":"0"}, "id": 1}]
[{"jsonrpc":"2.0","result":{"actualTimeoutSeconds":0,"actionPerformed":"NONE"},"id":1}]
|
...
Code Block | |
---|---|
title | |
Reset Up Heartbeat
Code Block |
---|
[{"jsonrpc": "2.0", "method": "HeartbeatAPING/v1.0/heartbeat", "params": {"preferredTimeoutSeconds":"10"}, "id": 1}]
[{"jsonrpc":"2.0","result":{"actualTimeoutSeconds":10,"actionPerformed":"NONE"},"id":1}] |
Tip |
---|
You should be able to reset the heartbeat by passing a value of actualTimeoutSeconds":0 and then restarting it by setting the required value |
Code Block | title |
EXAMPLE OF RESPONSE IF HEARTBEAT ISN'T RECEIVED WITHIN SPECIFIED TIME
Code Block |
---|
[{"jsonrpc": "2.0", "method": "HeartbeatAPING/v1.0/heartbeat", "params": {"preferredTimeoutSeconds":"10"}, "id": 1}] [{"jsonrpc":"2.0","result":{"actualTimeoutSeconds":10,"actionPerformed":"ALL_BETS_CANCELLED"},"id":1}] |
...