placeOrders Bad Request

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OzPunter
    Junior Member
    • Apr 2009
    • 161

    #1

    placeOrders Bad Request

    Can anyone have a look at this placeOrders string and tell me why all I ever get back is "HTTP/1.1 400 Bad Request"

    The string is

    {"marketId":"2.101060378","instructions":[{"selectionId":"2319357,"handicap":0,"side":"BACK" ,"orderType":"LIMIT","limitOrder":{"size":5.00,"pr ice":12.50,"persistenceType":"PERSIST"}}],"id":"1}"

    I can make most other functions work with the same formats but placing a bet dosen't want to play

    Is there any diagnostic response I can call that gives a better clue as to what is wrong other than
    "Bad Request"


    Kind Regards
    OzPunter
  • bnl
    Junior Member
    • Nov 2012
    • 108

    #2
    Because its bad JSON.

    {"selectionId":"2319357,"handicap":0,

    you started a quote on the selectionid, but never finished it.
    Its a number. Use no quotes at all.

    Notepad++ has a handy plugin, a JSON formatter, I think i catches these
    kinds of errors. Just paste it in and hit 'pretty print'

    /Björn

    Comment

    • OzPunter
      Junior Member
      • Apr 2009
      • 161

      #3
      Originally posted by bnl View Post
      Because its bad JSON.

      {"selectionId":"2319357,"handicap":0,

      you started a quote on the selectionid, but never finished it.
      Its a number. Use no quotes at all.

      Notepad++ has a handy plugin, a JSON formatter, I think i catches these
      kinds of errors. Just paste it in and hit 'pretty print'

      /Björn
      Thanks BNL,

      I fiddled with it for hours, gave up and went away for a hour and when I came back spotted the fault in minutes.

      Thanks

      OzPunter..

      Comment

      Working...
      X