Problem with PlaceOrders request

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ians1711
    Junior Member
    • Feb 2012
    • 6

    #1

    Problem with PlaceOrders request

    Developing a new program. Have successfully got most read-only requests working. Final piece of code to debug is the PlaceOrders request. Currently get a 400 - Bad Request from the server for the following params:

    {"marketId":"1.176181490","instructions":[{"orderType":0,"selectionId":1,"handicap":0.0,"sid e":1,"limitOrder":{"size":2.0,"price":1.01,"persis tenceType":1},"limitOnCloseOrder":null,"marketOnCl oseOrder":null}]}

    Can't see any more information in the HTTP response (but should I anyway?). Have compared this params string with what the API visualizer generates and can't see any difference. Any ideas what could be wrong??

    Thanks in advance


  • LiamP
    Junior Member
    • Oct 2015
    • 284

    #2
    Is this what you actually sent? orderType 0? persistenceType 1?

    Comment

    • ians1711
      Junior Member
      • Feb 2012
      • 6

      #3
      I'm dumping the output from the Newtonsoft call to JsonConvert.SerializeObject. These should be the ENUM values for OrderType.LIMIT and PersistenceType.PERSIST. Both these options were accepted by the API Visualiser?

      Comment

      • ians1711
        Junior Member
        • Feb 2012
        • 6

        #4
        This is what the API visualiser sends - the only difference I can see is the ENUM values have been replaced by text values.
        Request data: [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/placeOrders", "params": {"marketId":"1.176181490","instructions":[{"selectionId":"1","handicap":"0","side":"LAY", "or derType":"LIMIT","limitOrder":{"size":"2","price": "1.01","persistenceType":"PERSIST"}}]}, "id": 1}]

        Comment

        • ians1711
          Junior Member
          • Feb 2012
          • 6

          #5
          I think I have worked it out - had missed the following:

          [JsonConverter(typeof(StringEnumConverter))]

          Comment

          Working...
          X