...
- Grant permission for users to access your application
- Set the permission to expire after a specific date
- Store arbitrary information against each subscription
- View existing and historical application subscriptions
Info |
---|
|
...
Anchor | ||||
---|---|---|---|---|
|
Preconditions:
- Customer has a Betfair account.
- Vendor has a Betfair vendor account, the
...
- App Key for their app, and their (Vendor) session token
...
Example flow:
- Customer visits Vendor’s web site and decides to sign up for the Vendor’s app.
- The Customer purchases a 12 month subscription to the application app from the Vendor’s web site.
- The Vendor’s web site website server then calls the Account API-NG operation getApplicationSubscriptionToken, passing in the Vendor’s app keyApp Key, a valid session token Session Token for the Vendor’s Betfair account (to prove that they own that App Key) and the length of the subscription required (365 days in this scenario).
- Betfair returns to the vendor a Subscription Token of in the form of ABCD-EFGH-IJKL .to the Vendor
- The Subscription Token is then provided to the instance of the Vendor’s app used by the Customer.
This may happen in a number of ways, including:
i) Emailed from Vendor to Customer, who then types the subscription token Subscription Token into the app.
ii) Associated with the Customer’s app instance by the Vendor, so that the token can be cited by the app based on Customer login to the app. - The Vendors App app requires the Customer to login to Betfair using interactive login the Interactive Login method. See sample code interactive login Interactive Login sample code here
- Betfair returns Customer’s session token Session Token to the app.
- The subscription is then activated by the app calling activateApplicationSubscription passing in the subscription token Subscription Token and a valid session token Session Token for the Customer
AnchorCheckingSub CheckingSub
Checking a Customers Subscription History
CheckingSub | |
CheckingSub |
...
- Vendor’s app client requires Customer to login to Betfair using interactive login the Interactive Login method.
- Betfair returns Customer’s session token Session Token to the Vendor’s app client.
- Vendor’s app client calls getApplicationSubscriptionHistory citing Vendors App Key in the request body and the customer's session token Session Token in the X-Authentication header.
- Betfair returns Customer’s subscription history. If an empty list is returned then the customer has no current or previous subscription history (i.e. Customer is entirely new)
...
- Vendor’s app client requires Customer to login to Betfair using interactive login Interactive Login method.
- Betfair returns Customer’s session token Session Token to the Vendor’s app client.
- Vendor’s app client calls getVendorClientId citing Customer’s session token from step 1.
- Betfair returns Customer’s vendorClientId.
- Vendor’s App client sends Customer’s vendorClientId to Vendor’s app server.
- Vendor’s app server calls getApplicationSubscriptionHistory citing Vendor’s session tokenSession Token, Vendor’s app keyApp Key, and the vendorClientID from step 4.
- Betfair returns Customer’s complete history for the Vendor’s app (as identified by the app key cited in step 5). If an empty list is returned then the customer has no current or previous subscription history (i.e. Customer is entirely new).
...