Originally posted by AlgoTrader
View Post
The Next Sports Exchange API is Coming
Collapse
This topic is closed.
X
X
-
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.Originally posted by theswan1 View PostThanks. App Key duly arrived. Just need to work out why I'm getting a fault code of DSC-008 now!
The typical errors if for example skipping "filter:{}" in paramsBetfair Bots Made Easy
Comment
-
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
-
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
-
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
-
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 JSONBetfair Bots Made Easy
Comment
-
Those are estimates I learned from BF people:Originally posted by pulsoft1 View PostCannot find anything about planned release dates - I understand the beta is available, but that is about all I have found out.
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
-
1. They never pomised anything, no promise - no missed deadlineOriginally posted by pulsoft1 View PostHave BF missed the transactions deadline?
Also - your node.js tutorial - is that working with the WSDL or the new beta?
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
-
Hi,Originally posted by pulsoft1 View PostCannot find anything about planned release dates - I understand the beta is available, but that is about all I have found out.
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
-
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
-
Thanks Algotrader...Originally posted by AlgoTrader View Post1. 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.
Comment
-
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


Comment