The Next Sports Exchange API is Coming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • theswan1
    Junior Member
    • Jul 2010
    • 7

    #91
    Originally posted by AlgoTrader View Post
    Exactly, you are right
    Thanks. App Key duly arrived. Just need to work out why I'm getting a fault code of DSC-008 now!
    Java/Scala Blog - GitHub -

    Comment

    • AlgoTrader
      Junior Member
      • Mar 2012
      • 243

      #92
      Originally posted by theswan1 View Post
      Thanks. App Key duly arrived. Just need to work out why I'm getting a fault code of DSC-008 now!
      It usually means that you missed (misspelled) mandatory fields. You can post here your JSON and HTTP headers and we can check of what is wrong.

      The typical errors if for example skipping "filter:{}" in params
      Betfair Bots Made Easy

      Comment

      • theswan1
        Junior Member
        • Jul 2010
        • 7

        #93
        Thanks Algo. Managed to get it working by passing in an empty list of eventTypeIds as in the Groovy code snippet below:

        body = [
        "jsonrpc" : "2.0",
        "method" : "SportsAPING/v1.0/listCompetitions",
        "params" : ["filter" : ["eventTypeIds" : [] ] ],
        "id" : 1
        ]

        Would be good to get the empty filter working though but to see the request JSON I'll need to configure logging to capture the debug from Groovy http classes so will post this once log4j starts playing ball and writing what I want it to!
        Java/Scala Blog - GitHub -

        Comment

        • AlgoTrader
          Junior Member
          • Mar 2012
          • 243

          #94
          theswan1, you do something very wrong. The params is object, the filter is also object, not array. Objects are always in {}, not [].

          The correct params is
          "params" : { "filter": {}}

          Filter is mandatory, skipping it would break the request. The complete and realistic request is here:

          Code:
          Request:{
            "jsonrpc": "2.0",
            "id": 1,
            "method": "SportsAPING/v1.0/listCompetitions",
            "params": {
              "filter": {}
            }
          }
          
          Response:{
            "jsonrpc": "2.0",
            "result": [
              {
                "competition": {
                  "id": "2472064",
                  "name": "Ladies World Matchplay Singles 2013"
                },
                "marketCount": 4
              },
              {
                "competition": {
                  "id": "2472066",
                  "name": "Mixed Pairs World Matchplay 2013"
                },
                "marketCount": 4
              },
              ... skipped 
            ],
            "id" : 1
          }
          Last edited by AlgoTrader; 09-01-2013, 08:23 AM.
          Betfair Bots Made Easy

          Comment

          • theswan1
            Junior Member
            • Jul 2010
            • 7

            #95
            Hi Algo, thanks again for your response. Yes aware of the JSON differences between objects and maps and therefore {} and [] but the snippet was Groovy code not JSON.

            Managed to get it working with the following code:

            http.request (POST, JSON){req->
            body = [
            "jsonrpc" : "2.0",
            "method" : "SportsAPING/v1.0/listCompetitions",
            "params" : [filter:[:]],
            "id" : 1
            ]
            Java/Scala Blog - GitHub -

            Comment

            • AlgoTrader
              Junior Member
              • Mar 2012
              • 243

              #96
              Hopefully, we are not supposed to learn Groovy. Some languages have a concept of "superarray", they treat "numeric" arrays as the special case of "associative" arrays, in case of empty array they just can't magically detect whether the array is a regular numeric or associative.

              For example in PHP: http://stackoverflow.com/questions/1...ive-or-numeric - PHP Arrays: A good way to check if an array is associative or numeric

              That's the stuff I prefer to avoid, I like the beauty of the pure JSON
              Betfair Bots Made Easy

              Comment

              • pulsoft1
                Junior Member
                • Dec 2010
                • 8

                #97
                Does someonr know when roughly the new API will be relaesed?

                Cannot find anything about planned release dates - I understand the beta is available, but that is about all I have found out.

                Comment

                • AlgoTrader
                  Junior Member
                  • Mar 2012
                  • 243

                  #98
                  Originally posted by pulsoft1 View Post
                  Cannot find anything about planned release dates - I understand the beta is available, but that is about all I have found out.
                  Those are estimates I learned from BF people:

                  transactions are planned for the end of February
                  login stuff is planned for the end of April

                  That's just estimates from BF guys, do not consider it as the commitment or the promise. It may happen or may not.
                  Betfair Bots Made Easy

                  Comment

                  • pulsoft1
                    Junior Member
                    • Dec 2010
                    • 8

                    #99
                    Hi Algotrader

                    Have BF missed the transactions deadline?

                    Also - your node.js tutorial - is that working with the WSDL or the new beta?

                    Comment

                    • AlgoTrader
                      Junior Member
                      • Mar 2012
                      • 243

                      #100
                      Originally posted by pulsoft1 View Post
                      Have BF missed the transactions deadline?

                      Also - your node.js tutorial - is that working with the WSDL or the new beta?
                      1. They never pomised anything, no promise - no missed deadline

                      2. I never used WSDL, the old API lib parses the XML directly, WSDLs are needed for staticly typed languages like C# or C++ to generate model classes.

                      The new lib uses native JSON, no parsing needed.
                      Betfair Bots Made Easy

                      Comment

                      • MarkL
                        Junior Member
                        • Oct 2008
                        • 29

                        #101
                        Originally posted by pulsoft1 View Post
                        Cannot find anything about planned release dates - I understand the beta is available, but that is about all I have found out.
                        Hi,

                        We expect to open the next API up to a full public preview shortly. I.e., anyone who wants to sign up to the preview will be able to do so and test the next API.

                        We will also include bet placement, cancelling, and bet editing methods in the public preview.

                        Comment

                        • xaitek1
                          Junior Member
                          • Feb 2012
                          • 8

                          #102
                          This is good news Mark, will you also be able to share with us more details regarding data rates, throttling and pricing?
                          Application architecture can be very dependent on these constraints.

                          Comment

                          • gus
                            Senior Member
                            • Jan 2009
                            • 134

                            #103
                            Will the new version have its own log-in procedure?

                            The reason I ask is that without a login for the new version my test program for the new version still has to carry an awful lot of 'baggage' from my API6 programs ... Axis, the API WSDL etc etc just for the purpose of logging-in and it would good to be able to write a new fully independent 'lightweight' test program.

                            Also could you confirm that any future versions will still use REST as well as RPC? I'm currently using REST and don't want to be stuck with it if REST is likely to be dropped at some time in the future.

                            Comment

                            • pulsoft1
                              Junior Member
                              • Dec 2010
                              • 8

                              #104
                              Originally posted by AlgoTrader View Post
                              1. They never pomised anything, no promise - no missed deadline

                              2. I never used WSDL, the old API lib parses the XML directly, WSDLs are needed for staticly typed languages like C# or C++ to generate model classes.

                              The new lib uses native JSON, no parsing needed.
                              Thanks Algotrader...

                              Comment

                              • scrooge_mcduck
                                Junior Member
                                • Oct 2010
                                • 5

                                #105
                                Hi there, setting up my own bot using the php packages and modifying the example files that were very kindly posted on this forum was a very steep learning curve for me...

                                I'm just wondering if these files will still work when the new API goes live without any changes? If changes are required will I be able to use php to connect still?

                                I'm not that au fait with many programming languages and any info or advice you can offer would be greatly appreciated.

                                Comment

                                Working...
                                X