Specifying betID without marketID results in Exception (wrong input data or something like that)
Is a bit frustrating, make two cals just to cancel two bets on different markets
and in API 6 there was a limit for costless transational operations
cancelOrders why are all bets being cancelled?
Collapse
X
-
Yes, I checked the my code, and I discovered the error.
I placed the json string of $params into the request object, not the $params object. And now ... works it.
Leave a comment:
-
Post the actual JSON string that is being sent to the server rather than the code used to generate it.
It will look something like:
Code:{"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":"1.116526412","instructions":[{"betId":"43950294170","sizeReduction":2.0}],"customerRef":"1234"},"id":1}
Leave a comment:
-
Currently is the code:
$params = array(
"marketId" => $marketId ,
"betId" => array( $betId ) ,
"customerRef" => round( time() / 3 )
);
$cancelOrders = sportsApingRequest( $appKey , $sessionToken , 'cancelOrders' , json_encode( $params ) );
The sportsApingRequest function is cut and copy from betfair sample code.
I think that the error is with setting of marketId. I change the $betId to string or place into an instructions object, and single data or in array. Wrong-wrong-wrong.
Leave a comment:
-
Post the actual JSON request rather than the code - that will make it easier to spot the problem (hopefully)
Leave a comment:
-
Hello,
same problem
I wrote to my code (php)
$params = [
array(
"marketId" => $marketId , // $marketId is a string!
"betId" => $betId // $betId - string or long or string-array or long-array
)
]
OR
$params=[
array(
"marketId" => $marketId ,
"instructions" => [ { "betId" => $betId ( string or long ) } , {} ]
)
]
And I tried all in other possible combination.
The cancelOrders is cancelled all orders all in case.
What make I wrong?
Leave a comment:
-
A quick play around with the visualiser SUGGESTS that as soon as you specify a betId, then you also have to specify a marketId in order for the call to be accepted.
So, that would suggest it is not possible to place a cancelOrder call with just betIds specified and no marketId.
However, that is NOT a definitive answer. To get that, I suggest that you email the BDP team then - bdp@betfair.com - and ask them directly.Last edited by betdynamics; 04-11-2014, 04:28 PM.
Leave a comment:
-
I can't do this, because I can't allow to cancel all bets on all markets.Originally posted by betdynamics View PostI don't know the answer although I suspect that it will only cancel those bets whose betId has been specified.
However, surely it is not difficult to test?
Just pick a quiet time, put 3 or 4 bets on to the market at odds that won't be matched and then cancel some. Then see if all of the bets have been cancelled or just the ones that you specified.
Leave a comment:
-
I don't know the answer although I suspect that it will only cancel those bets whose betId has been specified.
However, surely it is not difficult to test?
Just pick a quiet time, put 3 or 4 bets on to the market at odds that won't be matched and then cancel some. Then see if all of the bets have been cancelled or just the ones that you specified.
Leave a comment:
-
Please answer
So, can anybody answer my question?
If marketId is not supplied, but bet id's are supplied (for one market) - will those instruction be executed?
Leave a comment:
-
@Neil, sorry for misunderstanding, but I asked about a different case.Originally posted by Betfair Developers Program View PostHi arteny1.
Yes, submitting:
Will cancel all unmatched bets on all markets.Code:[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {}, "id": 1}]
Kind Regards
Neil
In your case instuctions are empty, I am asking about case, when market id is not specified, but instructions is list of instructions with bet ids specified.
So in this case all bets from all markets are canceled or only bets with specified id's in instructins will be canceled?
Leave a comment:
-
Hi arteny1.
Yes, submitting:
Will cancel all unmatched bets on all markets.Code:[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/cancelOrders", "params": {}, "id": 1}]
Kind Regards
Neil
Leave a comment:
-
Are all markets all bets are canceled?
Docmuentation says:
marketId
String
If not supplied all bets are cancelled
My question is in this case (when marketId is not supplied) all bets from instructions are cancelled or every bet on all markets will be canceled (it looks too dangerous, necessary bets can be canceled)?
Leave a comment:
-
hi there, you also need to quote the MarketId when cancelling. So using the approach that you use, your json would look something like:
" [{""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/cancelOrders"", ""params"": {""betId"":" & myBetId & ", ""MarketId"":" & betMarketId & ",""id"": 1}}]"
Leave a comment:


Leave a comment: