Versions Compared

Key

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

...

Warning
titleIMPORTANT

To protect sensitive information such as your app key and secret, it is important that the token operation only be called from server to server.

 

 

Example REST request
Headers
  • X-Application: 'your app key'
  • X-Authentication : 'your session token'
  • Accept:  application/json
  • Content-Type:  application/json

Endpoint
Code Block
titleEndpoint
https://api.betfair.com/exchange/account/rest/v1.0/token/
Request
Code Block
titleRequest Body
{"client_id"="4534","grant_type":"AUTHORIZATION_CODE","code":"-22a1-12151008-000007cb61","client_secret":"bc183d-f5-40dc-82a6-d97681"}


Response 

Code Block
titleResponse
{"access_token":"KeOi+kyg2RvDK4HM+W46CvSnP5w=","refresh_token":"50d76117-7f85-375v-a38f-ffb332713f93","application_subscription":{"vendor_client_id":"456238"},"token_type":"BEARER","expires_in":"14400"}

 

Example Token request - Json-RPC

Headers
Code Block
titleHeaders
X-Application' : 'your App key'
X-Authentication' : 'your session token'
Accept:application/json


Endpoint

 

 

 

Code Block
titleEndpoint
https://api.betfair.com/exchange/account/json-rpc/v1

 

 

 

Request
Code Block
titleRequest
{"jsonrpc": "2.0", 
"method": "AccountAPING/v1.0/token", 
"params": {"client_id":"CLIENTID","grant_type":"AUTHORIZATION_CODE","code":"CODE","client_secret":"CLIENTSECRET"}, 
"id": 1
}

 

OAuth 2 Flow - Using the Refresh Token

...

Example request using REST

Example response

 

{"access_token":"KeOi+kyg2RvDK4HM+W46CvSnP5w=","refresh_token":"50d76117-7f85-375v-a38f-ffb332713f93","application_subscription":{"vendor_client_id":"456238"},"token_type":"BEARER","expires_in":"14400"}

 

...