Problem with my request?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lidder
    Junior Member
    • Jun 2014
    • 4

    #1

    Problem with my request?

    Can anyone see anything wrong with this request to place a bet?

    {
    "jsonrpc": "2.0",
    "method": "SportsAPING/v1.0/placeOrders",
    "params": {
    "marketId": "1.114408479",
    "instructions": {
    "selectionId": "8506230",
    "handicap": "0",
    "side": "LAY",
    "orderType": "LIMIT",
    "limitOrder": {
    "size": "2",
    "price": "1.2",
    "persistenceType": "LAPSE"
    }
    }
    },
    "id": 1
    }

    I am getting the following response...

    {
    u'jsonrpc': u'2.0',
    u'id': 1,
    u'error': {
    u'message': u'DSC-0018',
    u'code': -32602
    }
    }

    Thanks
  • lidder
    Junior Member
    • Jun 2014
    • 4

    #2
    Missed out square brackets...

    {
    "jsonrpc": "2.0",
    "method": "SportsAPING/v1.0/placeOrders",
    "params": {
    "marketId": "1.114408479",
    "instructions": [{
    "selectionId": "8506230",
    "handicap": "0",
    "side": "LAY",
    "orderType": "LIMIT",
    "limitOrder": {
    "size": "2",
    "price": "1.2",
    "persistenceType": "LAPSE"
    }
    }]
    },
    "id": 1
    }

    Comment

    • gus
      Senior Member
      • Jan 2009
      • 134

      #3
      Don't think you should have quotes around the selectionId (which is a long) , and price, size and handicap (which are doubles).

      For example my REST queries to placeOrders (which work) look like this:

      https://api.betfair.com/exchange/betting/rest/v1.0/placeOrders/{"marketId":"1.114402505","instructions":[{"select
      ionId":8484249,"side":"BACK","orderType":"LIMIT"," limitOrder":{"persistenceType":"PERSIST","price":3 .6,"size":4.0}}]}
      Last edited by gus; 21-06-2014, 09:57 AM. Reason: spelling!

      Comment

      Working...
      X