Hi tkw141. Haven't received your PM. Probably because you sent it to username Imlac, which is what I used to be, but I changed the structure of my account and couldn't use that forumname again so I used lmlac which is v similar except it starts with an l not I.
API-NG for dummies
Collapse
X
-
Worked out a way to login through VBA. But it's a massive bodge. Already had the cURL command line working, so just called that from VBA to get the session token. Takes 200 lines of code to pipe it through instead of probably 6 lines of XML/HTML gubbins, but 200 lines that work are better than 6 that don't!
Comment
-
I'm using the listevents call to get today's matches. The string returned is {"jsonrpc":"2.0","result":[{"event":{"id":"27151641","name":"TSW Pegasus FC (Res) v Sun Hei SC (Res)","countryCode":"HK","timezone":"GMT","openDa te":"2014-02-19T12:30:00.000Z"},"marketCount":14},{"event":{"id ":"27151646","name":"Humble Lions v Boys Town FC... etc etc
Now I want to get a list of ids for each event. So I use the parse function for the result collection in class module jsonlib, which returns an object. I can use the for each ... construct to return each event/marketcount pair as an object, but I can't work out how to get to the id field that is somewhere in the event object. I tried to use the tostring method to get a clue, and from that this code should work but it doesn't:
For Each eventItem In jason_obj
this_eventx = eventItem("event")
this_id = this_eventx("id")
Next
Anybody any clues? I can solve anagrams if you want to give it in that form
Comment
-
It's pretty straightforward. JSON is easier to work with than using SOAP. Most of the methods have the same functionality as the API6 equivalents. Logging in is a bit of a faff to get working - the excel example assumes you already have a session token. And the market menupath isn't fully replicated - the parentID concept isn't there as far as I can see.
Comment


Comment