listMarketBook issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doctormike
    Junior Member
    • Nov 2012
    • 55

    #1

    listMarketBook issue

    I have a ListMarketBook query

    This returns the expected string response:

    Dim strRequest As String

    strRequest = "{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listMarketBook"", ""params"":{""marketIds"":[""1.115258230""],""priceProjection"":{""priceData"":[""EX_BEST_OFFERS""]}}, ""id"": 1}"

    But if I try to limit the depth of prices returned to 1 thus:

    strRequest = "{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listMarketBook"", ""params"":{""marketIds"":[""1.115258230""],""priceProjection"":{""priceData"":[""EX_BEST_OFFERS""],""exBestOffersOverrides"":{""bestPricesDepth"":"" 1""}}, ""id"": 1}"

    I get a Bad Request error. Can anyone see where I’m going wrong?
    With regards
    Mike
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    bestPricesDepth is an integer, but you have specified it as a string (i.e. you need to remove the quotes surrounding the 1 in the JSON string):

    Code:
    strRequest = "{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listMarketBook"", ""params"":{""marketIds"":[""1.115258230""],""priceProjection"":{""priceData"":[""EX_BEST_OFFERS""],""exBestOffersOverrides"":{""bestPricesDepth"": 1}}, ""id"": 1}"

    Comment

    • doctormike
      Junior Member
      • Nov 2012
      • 55

      #3
      listMarketBook

      Thanks for the response, betdynamics. I've since had a response from the development team on this and the issue is solved. It did not involve eliminating the quotes from the integer, however (it works with quotes, although your suggestion made perfect sense to me). The problem was that I had omitted square brackets which should enclose the whole string. I have no idea why these are required when they weren't needed before the addition of priceData to the priceProjection element in 2013.
      Once again, thanks anyway.
      With regards
      Mike

      Comment

      • doctormike
        Junior Member
        • Nov 2012
        • 55

        #4
        listMarketBook again

        Hi betdynamics. Have just tried the depth integer without quotes, as you suggested, and without the square brackets. Works perfectly. I think my query just highlights my poor knowledge of string building!
        Many thanks
        Mike

        Comment

        Working...
        X