Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 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.

Headers

Name
Description
Sample
Accept (mandatory)Header that signals that the response should be returned as JSONapplication/json
X-Authentication (mandatory)Header that represents the session token that needs to be keep aliveSession Token
X-Application (optional)Header the Application Key used by the customer to identify the product.App Key

 
The presence of the "Accept: application/json" header will signal that the service should respond with JSON and not an HTML page

URL Definition

International jurisdictions:

Romania jurisdiction:

Parameters - NONE

 

Response structure

 

{
  "token":"<token_passed_as_header>",
  "product":"product_passed_as_header",
  "status":"<status>",
  "error":"<error>"
}

 

Status values

 

SUCCESS
FAIL

 

Error values

 

INPUT_VALIDATION_ERROR
INTERNAL_ERROR
NO_SESSION

 

Call sample

 

# full request
curl -k -i -H "Accept: application/json" -H "X-Application: AppKey" -H "X-Authentication: <token>" https://identitysso.betfair.com/api/keepAlive

 

 
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 4 hours8 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

 

curl -k -i -H "Accept: application/json" -H "X-Application: AppKey" -H "X-Authentication: SESSIONTOKEN" https://identitysso.betfair.com/api/keepAlive
  
{
  "token":"SESSIONTOKEN",
  "product":"AppKey",
  "status":"SUCCESS",
  "error":""
}

 

...

For security reasons, we require that the application using the API explicitly calls the Keep Alive operation no more than once within every 4 hours 8 hours in a response to user activity. In the case of non-interactive applications, these should call the keep-alive operation within every 4 8 hours whilst they are active.

...