Trying to login to create a session token, but I'm getting this error back:
It might be due to me having a two factor authentication - would this affect the login via the API?
This is the PHP cURL function I'm using:
Any help from previous experiences with this error would be awesome!
TIA - Jake
Code:
"status":"LOGIN_RESTRICTED","error":"STRONG_AUTH_CODE_REQUIRED"
This is the PHP cURL function I'm using:
PHP Code:
public function initiate_login()
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://identitysso.betfair.com/api/login');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username={$username}&password={$password}");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = 'Accept: application/json';
$headers[] = 'X-Application: '.$app_id;
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
print_r( $result );
}
curl_close($ch);
}
TIA - Jake


Comment