listRaceDetails params

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edison
    Junior Member
    • Jun 2019
    • 1

    #1

    listRaceDetails params

    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}]
    Last edited by BetfairDeveloperProgram; 17-06-2019, 10:58 AM. Reason: Removed App Key & Session
  • LiamP
    Junior Member
    • Oct 2015
    • 284

    #2
    You may want to get rid of that appKey and sessionToken!

    Comment

    • bfexplorer
      Senior Member
      • Sep 2018
      • 212

      #3
      Session is not valid after logout and its app key is not vendor's one, can be used only by his account.

      Comment

      Working...
      X