VBNet Sample (Yes really)

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts

  • SimonN
    replied
    Thank you, BetDynamics.

    Your suggestion somehow caused me to stumble over the solution.

    Bizarre really because there's nothing that I have seen about this in the documentation but it works when both inplay markets are set like so:

    ""turnInPlayEnabled"":""true"",""inPlayOnly"":""fa lse"",""textQuery"":""" & searchString & """}}"
    Edit: Just noticed your reply too cheers Jabe. To confirm, I wanted to return all events that the query string returned but only events that have not already started. Setting the above two inplay parameters as shown above returns only events not already started.
    Last edited by SimonN; 12-10-2016, 01:49 AM.

    Leave a comment:


  • jabe
    replied
    Originally posted by betdynamics View Post
    I don't think that turnInPlayEnabled is the correct parameter to determine pre-kick-off matches.

    turnInPlayEnabled denotes whether an event will EVER turn InPlay.


    Originally posted by betdynamics View Post
    To get a list of matches that will go inplay then you should set turnInPlayEnabled to true and set inPlayOnly to null (or omit it).
    Thanks, that's what I have.

    Leave a comment:


  • betdynamics
    replied
    Originally posted by LordRom View Post
    Ok, once you get it working you can make pretty good progress...


    Am stuck on this one though:-

    I want to cancel all orders on a market, but am getting error 400

    Code:
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {"marketId":"1.127522591",}, "id": 1}
    Can anyone point out the error in that please?

    Also, if I only wanted to cancel orders on a given selection, can you let me know what that would look like please?

    Thanks
    You have a spurious comma just after your marketId - try removing that.

    Leave a comment:


  • betdynamics
    replied
    Originally posted by LordRom View Post
    also listOrders is returning all orders despite me requesting orders for a market

    Code:
    {""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listCurrentOrders"", ""params"": {""marketId"":""" + marketId + """,""fromRecord"":0,""recordCount"":0},""id"":1}
    again, if i only want open orders (Executable?), how do i add that in please?

    thanks in advance.
    listCurrentOrders doesn't have a parameter called marketId.

    It uses a parameter called marketIds which takes an array as a parameter.

    For example:
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listCurrentOrders", "params": {"marketIds":["1.1234567","1.1234568"]}, "id": 1}

    I think listCurrentOrders only returns open orders anyway. listClearedOrders returns closed orders.
    Last edited by betdynamics; 11-10-2016, 09:30 PM.

    Leave a comment:


  • betdynamics
    replied
    Originally posted by jabe View Post
    What should I use to get a list of football matches that will be bettable in play on a particular day?
    To get a list of matches that will go inplay then you should set turnInPlayEnabled to true and set inPlayOnly to null (or omit it).

    Leave a comment:


  • LordRom
    replied
    also listOrders is returning all orders despite me requesting orders for a market

    Code:
    {""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listCurrentOrders"", ""params"": {""marketId"":""" + marketId + """,""fromRecord"":0,""recordCount"":0},""id"":1}
    again, if i only want open orders (Executable?), how do i add that in please?

    thanks in advance.

    Leave a comment:


  • LordRom
    replied
    Ok, once you get it working you can make pretty good progress...


    Am stuck on this one though:-

    I want to cancel all orders on a market, but am getting error 400

    Code:
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {"marketId":"1.127522591",}, "id": 1}
    Can anyone point out the error in that please?

    Also, if I only wanted to cancel orders on a given selection, can you let me know what that would look like please?

    Thanks

    Leave a comment:


  • jabe
    replied
    Originally posted by betdynamics View Post
    I don't think that turnInPlayEnabled is the correct parameter to determine pre-kick-off matches.

    turnInPlayEnabled denotes whether an event will EVER turn InPlay.
    What should I use to get a list of football matches that will be bettable in play on a particular day?

    Leave a comment:


  • betdynamics
    replied
    I don't think that turnInPlayEnabled is the correct parameter to determine pre-kick-off matches.

    turnInPlayEnabled denotes whether an event will EVER turn InPlay.

    Leave a comment:


  • jabe
    replied
    Originally posted by SimonN View Post
    T

    Now then.. why is this not working for the inplay parameter - it's returning games currently inplay when I was expecting it would only return pre kick off games with inplayonly set to false.

    Is it okay to use it with query string or have I made a booboo in my JSOn string?

    many thanks as ever.

    Simo
    There's another parameter - turnsInPlayEnabled - for that pre-start info. Having said that, I've just noticed the documentation says turnInPlayEnabled. Hmmm. I'd better check that out.

    Right, just checked it with and without the S in there. 113 with, 107 without, so I can only assume the difference is due to some not due to go inplay. Odd that the call worked with a wrong parameter listed.

    I had square brackets (and double quotes) around the true value too, and that didn't stop it working.
    Last edited by jabe; 11-10-2016, 02:09 PM.

    Leave a comment:


  • betdynamics
    replied
    Try removing the quotes around false in the InPlay declaration, i.e.

    ""inPlayOnly"":false

    rather than

    ""inPlayOnly"":""false""

    Leave a comment:


  • SimonN
    replied
    Thank you for that again, Jabe - much appreciated confirmation that my assumption was okay.

    GetListEventsRequestString = "{""filter"":{""eventTypeIds"":[""" & EventTypeId & """],""inPlayOnly"":""false"",""textQuery"":""" & searchString & """}}"

    Now then.. why is this not working for the inplay parameter - it's returning games currently inplay when I was expecting it would only return pre kick off games with inplayonly set to false.

    Is it okay to use it with query string or have I made a booboo in my JSOn string?

    many thanks as ever.

    Simo

    Leave a comment:


  • jabe
    replied
    Originally posted by LordRom View Post
    So I've started a fresh project, added everything in from the old one and it's working fine. No idea what the issue was with the original project.

    Thanks for your help though Jabe.
    You're very welcome. I did that recently with my main program - something must have got corrupted, and I just couldn't open it, but I worked on the assumption that the .vb files are all basically text files, so they should have been okay. It took me ages, adding all the new classes (and there are lots) to the new project, and then overwriting them with the original files. It was only when I'd nearly finished that I discovered an option called Add Existing Item (Aaaaaarrrrrgggghhhhhh!!!!!!!!!!!).
    Last edited by jabe; 10-10-2016, 04:51 PM.

    Leave a comment:


  • LordRom
    replied
    So I've started a fresh project, added everything in from the old one and it's working fine. No idea what the issue was with the original project.

    Thanks for your help though Jabe.

    Leave a comment:


  • LordRom
    replied
    Thanks Jabe.

    When I add your sample code to my exsting app it falls over on assigning c1.

    Code:
    Dim c1 = jsonBookObject.Result(0).Runners(0).ExchangePrices.AvailableToBack.Count
    Code:
    An unhandled exception of type 'System.NullReferenceException' occurred in BasicApp.exe
    
    Additional information: Object reference not set to an instance of an object.
    When I view the jsonBookObject it again doesn't reference the 'ex' level of the jsonObject.

    So I guess this is something more fundamental with my installation.

    Leave a comment:

Working...
X