VBNet Sample (Yes really)

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LordRom
    Junior Member
    • Sep 2011
    • 11

    #211
    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.

    Comment

    • LordRom
      Junior Member
      • Sep 2011
      • 11

      #212
      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.

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #213
        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.

        Comment

        • SimonN
          Junior Member
          • Dec 2014
          • 71

          #214
          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

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #215
            Try removing the quotes around false in the InPlay declaration, i.e.

            ""inPlayOnly"":false

            rather than

            ""inPlayOnly"":""false""

            Comment

            • jabe
              Senior Member
              • Dec 2014
              • 705

              #216
              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.

              Comment

              • betdynamics
                Junior Member
                • Sep 2010
                • 534

                #217
                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.

                Comment

                • jabe
                  Senior Member
                  • Dec 2014
                  • 705

                  #218
                  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?

                  Comment

                  • LordRom
                    Junior Member
                    • Sep 2011
                    • 11

                    #219
                    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

                    Comment

                    • LordRom
                      Junior Member
                      • Sep 2011
                      • 11

                      #220
                      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.

                      Comment

                      • betdynamics
                        Junior Member
                        • Sep 2010
                        • 534

                        #221
                        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).

                        Comment

                        • betdynamics
                          Junior Member
                          • Sep 2010
                          • 534

                          #222
                          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.

                          Comment

                          • betdynamics
                            Junior Member
                            • Sep 2010
                            • 534

                            #223
                            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.

                            Comment

                            • jabe
                              Senior Member
                              • Dec 2014
                              • 705

                              #224
                              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.

                              Comment

                              • SimonN
                                Junior Member
                                • Dec 2014
                                • 71

                                #225
                                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.

                                Comment

                                Working...
                                X