No announcement yet.

Getting Started - Current Error

  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Started - Current Error

    I'm new here. Just trying to work out how this works.

    I've got my Session Token from the ssoid value and Appy Key from here

    I'm using the delay key, active says yes, delay is yes, subscription required is yes, owner managed is no.

    Here's the code I'm using

    echo "1. Get all Event Types....\n";
    $allEventTypes = getAllEventTypes($APP_KEY, $SESSION_TOKEN);

    function getAllEventTypes($appKey, $sessionToken)
    $jsonResponse = sportsApingRequest($appKey, $sessionToken, 'listEventTypes', '{"filter":{}}');
    return $jsonResponse[0]->result;

    My error

    Notice: Trying to access array offset on value of type null in C:\wamp86\www\betfair\jsonrpc.php on line 50

    Notice: Trying to get property 'result' of non-object in C:\wamp86\www\betfair\jsonrpc.php on line 50

    Line 50 is

    return $jsonResponse[0]->result;

  • #2
    the last time I looked jsonResponse was *not* an array but a plain old object (ie [0] is not valid) - when playing around print_r($jsonResponse) can be very helpful to find these problems, you'll find the $jsonResponse->result will be the right code


    • #3
      Will try later, thanks.