what parameters to place for the listRaceDetails query to work?
<?php
$appKey = '';
$sessionToken = '';
$operation = 'listRaceDetails';
$params = '';
print_r(json_encode(sportsApingRequest($appKey, $sessionToken, $operation, $params)));
function sportsApingRequest($appKey, $sessionToken, $operation, $params)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.betfair.com/exchange/betting/json-rpc/v1");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:',
'X-Application: ' . $appKey,
'X-Authentication: ' . $sessionToken,
'Accept: application/json',
'Content-Type: application/json'
));
$postData =
'[{ "jsonrpc": "2.0", "method": "SportsAPING/v1.0/' . $operation . '", "params" :' . $params . ', "id": 1}]';
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$response = json_decode(curl_exec($ch));
curl_close($ch);
if (isset($response[0]->error)) {
echo 'Call to api-ng failed: ' . "\n";
echo 'Response: ' . json_encode($response);
exit(-1);
} else {
return $response;
}
}
?>
Call to api-ng failed: Response: [{"jsonrpc":"2.0","error":{"code":-32601,"message":"DSC-0021"},"id":1}]
<?php
$appKey = '';
$sessionToken = '';
$operation = 'listRaceDetails';
$params = '';
print_r(json_encode(sportsApingRequest($appKey, $sessionToken, $operation, $params)));
function sportsApingRequest($appKey, $sessionToken, $operation, $params)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.betfair.com/exchange/betting/json-rpc/v1");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:',
'X-Application: ' . $appKey,
'X-Authentication: ' . $sessionToken,
'Accept: application/json',
'Content-Type: application/json'
));
$postData =
'[{ "jsonrpc": "2.0", "method": "SportsAPING/v1.0/' . $operation . '", "params" :' . $params . ', "id": 1}]';
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$response = json_decode(curl_exec($ch));
curl_close($ch);
if (isset($response[0]->error)) {
echo 'Call to api-ng failed: ' . "\n";
echo 'Response: ' . json_encode($response);
exit(-1);
} else {
return $response;
}
}
?>
Call to api-ng failed: Response: [{"jsonrpc":"2.0","error":{"code":-32601,"message":"DSC-0021"},"id":1}]


Comment