BF_Session_Management: Session Management.

Description Usage Arguments Details Value Author(s) References See Also

Description

login enables customers to log in to the API service and initiates a secure session for the user. Users can have multiple sessions 'alive' at any point in time.

logout allows you to explicitly end your session.

keepAlive can be used to stop a session timing out. Every call to the Betfair API returns a token, in the sessionToken field, that identifies a login session. Every time your application calls the Betfair API and is returned a sessionToken, the session timeout is reset to approximately 20 minutes. After the timeout has passed, the session is expired and you need to login again.
If you want to keep your login session active, but your application has not made any Betfair API calls that would generate a new sessionToken and reset the session timeout, you can call keepAlive to obtain a new sessionToken and reset the session timeout.

bfSessionTocken returns the current session token, if any, NULL otherwise.

Usage

1
2
3
4
5
bfLogin(username, password, productId=82, ipAddress="0", locationId=0, vendorSoftwareId=0, curlOpts=list())
bfLogout(curlOpts = list())
keepAlive(curlOpts = list())
bfSessionToken()
bfSessionHandler()

Arguments

username

The username with which to login to the API for a new session.

password

The password with which to login to the API for a new session.

productId

The API product ID with which to login to the API for a new session. If you want to use the Free Access API, use 82. If you are a paying API subscriber, use the Id provided when you signed up.

ipAddress

For applications that proxy the user's connection, the IP address of the user's computer. Betfair may inform you in the future if you need to provide this field, otherwise set this field to 0 (the default).

locationId

The location ID with which to login for a new session.

vendorSoftwareId

The vendor software ID with which to login to the API for a new session. This is only relevant for software vendors and is provided when software vendors sign up.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

Details

bfSessionHandler (not implemented yet) creates a session handler used to access multiple sessions. A betfair functions can be accessed through obj$foo(...), where obj is the session handler object returned by bfSessionHandler. All the functions in the handler share common parent environment where the .sessionToken is stored.

Every betfair API request/response must contains a session token. All functions in betfairly-package store the session token in .GlobalEnv in .sessionToken variable by <<- assignment. To manage a single account this is appropriate. To manipulate several different sessions at the same time create a handler for each session with bfSessionHandler.

Value

invisibly a sessionToken string

Author(s)

Vitalie Spinu (spinuvit@gmail.com)

References

http://code.google.com/p/betfairly/, https://docs.developer.betfair.com/betfair/

See Also

betfairly-package bfSimpleOutput-class


vspinu/betfairly documentation built on May 3, 2019, 7:08 p.m.