...
Table of Content Zone | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||
LoginThe Betfair API offers three login flows for developers, depending on the use case of your application:. Non-Interactive loginif you are building an application which will run autonomously, there is a separate login flow to follow to ensure your account remains secure. Interactive loginif you are building an application which will be used interactively, then this is the flow for you. This flow has two variants: Interactive login - Desktop ApplicationThis login flow makes use of Betfair's login pages and allows your app to gracefully handle all errors and re-directions in the same way as the Betfair website Interactive login - API methodThis flow makes use of a JSON API Endpoint and is the simplest way to get started if you are looking to create your own login form.
Login Request Limits
Login FAQ'sWhen should I use the non-interactive login?You should use the non-interactive login when the user will not be present to log into the application themselves. An example of this is an automated bot that might need to login without the user triggering a login. 3rd Party interfaces to Betfair, used by multiple users, and which act as a direct proxy of a user request should use the interactive login instead. Why is the redirect URL required for the interactive login?The redirect URL is required in order to post the session token to the application at the end of the login process. For further details of how to handle the session token please see Interactive Login from a Desktop Why isn’t there a non-interactive endpoint that accepts only a username and a password?Betfair take user security very seriously and have made many enhancements to the login process alongside additional changes which have been made at the request of some of our regulators. This means that you cannot rely upon a username and password being the only pieces of information that may be required at login. Some examples of workflows currently in use are 2 factor authorisation codes, additional National Identifiers for a region or requests for additional account information or account migration. Why does my session time out, even though I’ve been retrieving prices?For security reasons, we require that the application using the API explicitly calls the Keep Alive operation no more than once within every 8 hours 24 hours in a response to user activity. In the case of non-interactive applications, these should call the keep-alive operation within every 8 24 hours whilst they are active. Why is my interactive login/logout request failing with errorCode=FORBIDDEN?Your Application Key App Key is not using the correct redirect URL. By default only https://www.betfair.com will be allowed as the redirect URL. Keep AliveYou can use Keep Alive to extend the session timeout period. The minimum session time is currently 20 minutes (Italian Exchange). On the international (.com) Exchange the current session time is 8 is 24 hours. Therefore, you should request Keep Alive within this time to prevent session expiry. If you don't call Keep Alive within the specified timeout period, the session will expire. Please note: Session times aren't determined or extended based on API activity. Please note: You can configure the timeout via My Account > Logout Preferences if required Headers
The presence of the "Accept: application/json" header will signal that the service should respond with JSON and not an HTML page URL Definition (Global)
Other JurisdictionsPlease use the below if your country of residence is in one of the list jurisdictions.
ParametersThe Keep Alive operation requires no parameters. Response structure
Status values
Error values
Call sample
You can use Keep Alive to extend the session timeout period. The minimum session time is currently 20 minutes (Italian Exchange). On the international (.com) Exchange the current session time is 8 hours24 hours. Therefore, you should request Keep Alive within this time to prevent session expiry. If you don't call Keep Alive within the specified timeout period, the session will expire. Session times aren't determined or extended based on API activity. Keep Alive success
LogoutYou can use Logout to terminate your existing session. URL Definitionhttps://identitysso.betfair.com/api/logout The presence of the "Accept: application/json" header will signal that the service should respond with JSON and not an HTML page Headers
Response structure
Status values
Error values
Call sample
|
...