Betting API returns empty responses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madz
    Junior Member
    • Aug 2019
    • 3

    #1

    Betting API returns empty responses

    Hello,

    I am experiencing a very strange behavior of the Beting API.
    I am using my Live key and currently there are a lot of events (at the time of writing) but all the requests return a 200 with an empty Result array. Like that:

    [{"jsonrpc":"2.0","result":[],"id":1}]
    Whatever Operation I pick - the result is always that response.

    An example of a real request from the last few minutes is:

    URL: HEADERS:
    array(6) {
    ["X-Application"]=>
    string(16) "my live key ********"
    ["X-Authentication"]=>
    string(44) "an actual token *******"
    ["Accept"]=>
    string(16) "application/json"
    ["Content-Type"]=>
    string(16) "application/json"
    ["Accept-Encoding"]=>
    string(13) "gzip, deflate"
    ["Connection"]=>
    string(10) "keep-alive"
    }
    BODY:
    [{ "jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter": {"eventTypeIds":[1],"inPlayOnly":true}}, "id": 1}]
    Anyone experiencing similar issues?
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    Odd. I've got a test page in my program and I've tried your filter with listEvents and it returned data. I saved a listEvents call from the initialisation section of my program and the only differences were that I'd put quotes around the eventTypeIds values and the inPlayOnly value. However, the test I ran worked with and without quotes. Just a tip here - for MarketIds, ALWAYS put quotes round them. This is because the format is numeric with a decimal point within. If one ends in a zero, and you have not ensured it is treated as a string, you may lose a final zero. So a MarketId such as 432.970 without quotes will be treated as 432.97.
    Last edited by jabe; 22-08-2019, 03:40 PM.

    Comment

    • madz
      Junior Member
      • Aug 2019
      • 3

      #3
      Hey Jabe,
      thanks a lot for your tip, I'll check whether it's already done, and do it if not.

      But I am still getting empty arrays right now when I execute those requests.
      I am wondering whether there might be some limitations on the account, although I haven't seen/received any notification whatsoever...

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        Have you tried it with your other key? The only limitation I know of that applies generally to accounts is that you need to have made a bet and had it settled at some point within the previous three months.

        Comment

        • madz
          Junior Member
          • Aug 2019
          • 3

          #5
          Hello again,
          I have tried with the delayed key, but the result is the same.

          The settled bet in the last three months is another beer though. As there have been some idle time more than that. But I never saw any such requirement anywhere in the documentation, how do you know about it?

          Comment

          • jabe
            Senior Member
            • Dec 2014
            • 705

            #6
            Originally posted by madz View Post
            Hello again,
            I have tried with the delayed key, but the result is the same.

            The settled bet in the last three months is another beer though. As there have been some idle time more than that. But I never saw any such requirement anywhere in the documentation, how do you know about it?
            I can't remember, but it may have been a particular error code in one of my programs. I usually just put a minimum bet on a strong favourite in an event that's happening soon. If/when it happens again, I'll try to remember to update this thread further. I tried a search on the whole forum, but haven't found anything.

            Comment

            • Ramstyler
              Junior Member
              • Oct 2022
              • 4

              #7
              Did anyone find out if this limitation is the reason for the empty result response?

              Comment

              • TooLateToTheParty
                Junior Member
                • Jan 2021
                • 10

                #8
                Might be worth trying it on the visualiser page..

                https://docs.developer.betfair.com/v...ts-operations/

                ..and seeing if you get the same results.

                Comment

                Working...
                X