Hi,
I haven't contributed for a long time but I have been using the API successfully for years. When I originally developed my code base I ran into a problem with ReplaceOrders that I couldn't solve at that time, so I got around the problem by using a different strategy by canceling the bet and resetting the price and placing a new bet, while it works OK it's time consuming and clumsy.
So I have been going over my code base and tidying up some of my sloppy code, which brings me to ReplaceOrders again.
There are two almost identical functions, newPrice and newSize.. The newPrice function works fine, the newSize function fails every time giving a HTTP/1.1 400 Bad Request error, suggesting that the URL failed.. ( This error message is misleading)
The URL in question is,
https://api.betfair.com/exchange/bet...replaceOrders/ and is identical for both functions.
The Parameter string passed for newPrice is
'{"marketId":"theMARKETID","instructions":[{"betId":"theBETID","newPrice":theNEWPRICE}]},"id":1,"jsonrpc":"2.0"}' with the relevant values inserted
This parameter string is accepted and the new price is applied.
The Parameter string passed for newSize is
{"marketId":"theMARKETID","instructions":[{"betId":"theBETID","newSize":theNEWSIZE}]},"id":1,"jsonrpc":"2.0"} with the relevant values inserted
The newSize parameter string throws the HTTP/1.1 400 Bad Request error, suggesting that the URL failed, so I've changed my code to ensure that the exact same URL and HTTPS setup is common to both, proving that the newSize parameter string causes the failure.
When carrying out these operations manually on the website, both pass with the newSize function resulting in a new bet being created. While waiting for bets to be matched is becomes necessary to manipulate the size and price continuously and it is necessary to complete these processes in the shortest possible time but at the moment the process I have to use is to cancel a bet and create a new one.
When the ruling Back or Lay price changes it is necessary to adjust both the bet price and the size of the bet , or to cancel the bet and create a new bet putting it at the end of the bet queue.
Because it's not possible to change both the price and size in the same instruction I would really like to know why the newSize function fails and how to get it working.
Kind Regards
OzPunter
I haven't contributed for a long time but I have been using the API successfully for years. When I originally developed my code base I ran into a problem with ReplaceOrders that I couldn't solve at that time, so I got around the problem by using a different strategy by canceling the bet and resetting the price and placing a new bet, while it works OK it's time consuming and clumsy.
So I have been going over my code base and tidying up some of my sloppy code, which brings me to ReplaceOrders again.
There are two almost identical functions, newPrice and newSize.. The newPrice function works fine, the newSize function fails every time giving a HTTP/1.1 400 Bad Request error, suggesting that the URL failed.. ( This error message is misleading)
The URL in question is,
https://api.betfair.com/exchange/bet...replaceOrders/ and is identical for both functions.
The Parameter string passed for newPrice is
'{"marketId":"theMARKETID","instructions":[{"betId":"theBETID","newPrice":theNEWPRICE}]},"id":1,"jsonrpc":"2.0"}' with the relevant values inserted
This parameter string is accepted and the new price is applied.
The Parameter string passed for newSize is
{"marketId":"theMARKETID","instructions":[{"betId":"theBETID","newSize":theNEWSIZE}]},"id":1,"jsonrpc":"2.0"} with the relevant values inserted
The newSize parameter string throws the HTTP/1.1 400 Bad Request error, suggesting that the URL failed, so I've changed my code to ensure that the exact same URL and HTTPS setup is common to both, proving that the newSize parameter string causes the failure.
When carrying out these operations manually on the website, both pass with the newSize function resulting in a new bet being created. While waiting for bets to be matched is becomes necessary to manipulate the size and price continuously and it is necessary to complete these processes in the shortest possible time but at the moment the process I have to use is to cancel a bet and create a new one.
When the ruling Back or Lay price changes it is necessary to adjust both the bet price and the size of the bet , or to cancel the bet and create a new bet putting it at the end of the bet queue.
Because it's not possible to change both the price and size in the same instruction I would really like to know why the newSize function fails and how to get it working.
Kind Regards
OzPunter
Comment