loginBF | R Documentation |
loginBF
logs in to Betfair, via the API-NG JSON interactive end point.
loginBF(username, password, applicationKey, sslVerify = TRUE)
username |
Character string containing Betfair username and must be defined. See Examples. |
password |
Character string containing Betfair password and must be defined. See Examples. |
applicationKey |
Character string containing Betfair application key and must be defined. See Examples. |
sslVerify |
Boolean. This argument defaults to TRUE and is optional. In some cases, where users have a self signed SSL Certificate, for example they may be behind a proxy server, Betfair will fail login with "SSL certificate problem: self signed certificate in certificate chain". If this error occurs you may set sslVerify to FALSE. This does open a small security risk of a man-in-the-middle intercepting your login credentials. See Examples. |
This login function must be executed first, before any other
functions in this package. Failure to execute loginBF
renders
everything else pointless. You will require a valid Betfair username,
password and application key. Obtain a Betfair application key by following
the instructions here:
username
, password
and applicationKey
are all mandatory
and must be user defined.
Every time loginBF
is executed, a new login to Betfair occurs. Don't
login more than is necessary.
Response from Betfair will be stored in loginReturn
parse from
JSON as a list. This will include the statuses SUCCESS, FAIL or error, if
it is not null, returned as a colon separated concatenated string. Examples
of login responses for the JSON API interactive endpoint can be found here:
For error values, see:
credentials
variableThis variable stores the defined Betfair username and password. R function objects are ephemeral. This variable dies immediately after function execution. Your Betfair username and password is not stored anywhere outside this function and details must always be passed to the function on execution.
product
and token
envrionment variablesThese two envrionment variables store the session based authentication token and product string. They are required for all other functions in this package.
## Not run: loginBF(username = "YourBetfairUsername", password = "YourBetfairPassword", applicationKey = "YourBetfairAppKey" ) # Login with self signed SSL Certificate loginBF(username = "YourBetfairUsername", password = "YourBetfairPassword", applicationKey = "YourBetfairAppKey", sslVerify = FALSE ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.