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
...
https://api.betfair.com/exchange/heartbeat/json-rpc/v1
...
HeartbeatAPING/v1.0/heartbeat
Italian Exchange
...
Interface
...
Endpoint
...
<method> Example
...
JSON-RPC
...
https://api.betfair.it/exchange/heartbeat/json-rpc/v1
...
HeartbeatAPING/v1.0/heartbeat
Spanish Exchange
...
Interface
...
Endpoint
...
<method> Example
...
JSON-RPC
...
https://api.betfair.es/exchange/heartbeat/json-rpc/v1
...
HeartbeatAPING/v1.0/heartbeat
Operation Summary
...
...
Heartbeat API#heartbeat ( int preferredTimeoutSeconds )
Detailed documentation
Heartbeat
...
bgColor | #FFFFFF |
---|---|
titleBGColor | #C8D0E4 |
title | heartbeat |
Heartbeat API#HeartbeatReport heartbeat ( int preferredTimeoutSeconds ) throws Heartbeat 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.
...
Parameter name
...
Type
...
Required
...
Description
...
preferredTimeoutSeconds
...
int
...
...
Maximum period in seconds that may elapse (without a subsequent heartbeat request), before a cancellation request is automatically submitted on your behalf. The minimum value is 10, the maximum value permitted is 300. Passing 0 will result in your heartbeat being unregistered (or ignored if you have no current heartbeat registered). You will still get an actionPerformed value returned when passing 0, so this may be used to determine if any action was performed since your last heartbeat, without actually registering a new heartbeat. Passing a negative value will result in an error being returned, INVALID_INPUT_DATA. Any errors while registering your heartbeat will result in a error being returned, UNEXPECTED_ERROR. Passing a value that is less than the minimum timeout will result in your heartbeat adopting the minimum timeout. Passing a value that is greater than the maximum timeout will result in your heartbeat adopting the maximum timeout. The minimum and maximum timeouts are subject to change, so your client should utilise the returned actualTimeoutSeconds to set an appropriate frequency for your subsequent heartbeat requests.
...
Return type
...
Description
...
...
Response from heartbeat operation
...
Throws
...
Description
...
...
Thrown if the operation fails
...
This interface does not define any events.
...
bgColor | #FFFFFF |
---|---|
titleBGColor | #FFCC33 |
title | HeartbeatReport |
Response from heartbeat operation
...
Field name
...
Type
...
Required
...
Description
...
actionPerformed
...
...
...
The action performed since your last heartbeat request.
...
actualTimeoutSeconds
...
int
...
...
The actual timeout applied to your heartbeat request, see timeout request parameter description for details.
...
bgColor | #FFFFFF |
---|---|
titleBGColor | #99CC66 |
title | ActionPerformed |
...
Value
...
Description
...
NONE
...
No action was performed since last heartbeat, or this is the first heartbeat
...
CANCELLATION_REQUEST_SUBMITTED
...
A request to cancel all unmatched bets was submitted since last heartbeat
...
ALL_BETS_CANCELLED
...
All unmatched bets were cancelled since last heartbeat
...
SOME_BETS_NOT_CANCELLED
...
Not all unmatched bets were cancelled since last heartbeat
...
CANCELLATION_REQUEST_ERROR
...
There was an error requesting cancellation, no bets have been cancelled
...
CANCELLATION_STATUS_UNKNOWN
...
There was no response from requesting cancellation, cancellation status unknown
...
bgColor | #FFFFFF |
---|---|
titleBGColor | #E4B8D6 |
title | APINGException |
This exception is thrown when an operation fails
...
Error code
...
Description
...
INVALID_INPUT_DATA
...
Invalid input data
...
INVALID_SESSION_INFORMATION
...
The session token passed is invalid
...
NO_APP_KEY
...
An application key is required for this operation
...
NO_SESSION
...
A session token is required for this operation
...
INVALID_APP_KEY
...
The application key passed is invalid
...
UNEXPECTED_ERROR
...
An unexpected internal error occurred that prevented successful request processing.
...
Other parameters
...
Type
...
Required
...
Description
...
errorDetails
...
String
...
Specific error details
...
requestUUID
...
String
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}]
|
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 |
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}] |
Appanvil karma designer | ||||
---|---|---|---|---|
summary | Home | API Status | Historical Data | Vendor Program | Developer Forum Navigation Data For Applications | page | {"id":"EJyr1dNQxAJdJguiodbJA","name":"page","children":[{"id":"iOCUkGtPzoYzSRQ_IZAXO","params":{"background":{"light":"#ffffff99","dark":"#1d212599"},"padding":20,"gap":10,"backgroundSize":"contain","image":{"value":"att19398657","target":"_blank","type":"attachment"}},"children":[],"name":"section"},{"params":{"padding":0,"gap":0,"image":{"value":"https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMzg3MzF8MHwxfHNlYXJjaHw2fHxncmFkaWVudHxlbnwwfDB8fHwxNzAyMzkyMDI1fDA&ixlib=rb-4.0.3&q=80&w=1080","target":"_self","type":"link"},"background":||
Appanvil karma designer | ||||
|
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
Heartbeat API#heartbeat ( int preferredTimeoutSeconds ) |
Detailed documentation
Heartbeat
Operations
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Panel | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
Heartbeat API#HeartbeatReport heartbeat ( int preferredTimeoutSeconds ) throws Heartbeat 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.
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
Response from heartbeat operation
|
Enums
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Exceptions
Anchor | ||||
---|---|---|---|---|
|
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}]
|
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 |
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}] |