|
|||||||
| API Services Discussion about the Sports Application Programming Interface (API) ,the platform on which participants in the Developers Program are able to build customised tools and interfaces to use with the Betfair (Sports) Exchange. |
| Post Reply |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Using the UpdateBet function, I am able to update either the size or the price of an unmatched bet on a horse race. But I don't seem to be able the change the bet persistence of the bet. On the Betfair website there are 3 radio buttons that let you change the persistence quickly and easily. How can I change the persistence type of an existing unmatched bet?
|
|
#2
|
|||
|
|||
|
Quote:
|
|
#4
|
|||
|
|||
|
Quote:
Code:
updateBets : function(cb) {
console.log('===== updateBets for betId=%s, change bet size =====',betId);
var bet = {
betId: betId,
newBetPersistenceType: "NONE",
newPrice : "1.01",
newSize : "5.0",
oldBetPersistenceType: "IP",
oldPrice : "1.01",
oldSize : "5.0"
}
var inv = session.updateBets([bet])
Code:
{ header:
{ errorCode: 'OK',
minorErrorCode: null,
sessionToken: 'removed',
timestamp: Fri, 06 Apr 2012 15:01:53 GMT },
betResults:
[ { betId: '19209544488',
newBetId: '0',
sizeCancelled: '0.0',
newSize: '0.0',
newPrice: '0.0',
resultCode: 'BET_IN_PROGRESS',
success: 'false' } ],
errorCode: 'BET_IN_PROGRESS',
minorErrorCode: null }
|
|
#5
|
|||
|
|||
|
It works now
Code:
{ header:
{ errorCode: 'OK',
minorErrorCode: null,
sessionToken: 'removed',
timestamp: Fri, 06 Apr 2012 15:19:46 GMT },
betResults:
[ { betId: '19209925060',
newBetId: '0',
sizeCancelled: '0.0',
newSize: '5.0',
newPrice: '1.01',
resultCode: 'PERSISTENCE_MODIFICATION_SUCCESS',
success: 'true' } ],
errorCode: 'OK',
minorErrorCode: null }
|
|
#6
|
|||
|
|||
|
The parameters that you used was the first thing that I had originally tried. Then I tried various other combinations which didn't work either. I tried it again now and it is still not working.
This is what I sent: <UpdateBets> <betId>nnnnnnnnn</betId> <NewBetPersistenceType>SP</NewBetPersistenceType> <newPrice>1000</newPrice> <newSize>5</newSize> <oldBetPersistenceType>NONE</oldBetPersistenceType> <oldPrice>1000</oldPrice> <oldSize>5</oldSize> </UpdateBets> And this is what I got back: <n2:UpdateBetsResult xsi:type="n2:UpdateBetsResult"> <betId xsi:type="xsd:long">nnnnnnnnnn</betId> <newBetId xsi:type="xsd:long">0</newBetId> <sizeCancelled xsi:type="xsd:double">0.0</sizeCancelled> <newSize xsi:type="xsd:double">0.0</newSize> <newPrice xsi:type="xsd:double">0.0</newPrice> <resultCode xsi:type="n2:UpdateBetsResultEnum">INVALID_PRICE_A ND_SIZE</resultCode> <success xsi:type="xsd:boolean">false</success> </n2:UpdateBetsResult> The documentation only talks about being able to change the price or the size. But the old persistence and new persistence are parameters to the UpdateBets function. Can you see anything different in what I have done compared to what you have done? |
|
#8
|
|||
|
|||
|
I have figured out what I was doing incorrectly.
The tag for NewBetPersistence type needed to be newBetPersistenceType. For all the other tags I correctly had a lower case letter to start with, but unfortunately I had put a capital N instead of a lower case n on newBetPersistenceType. It is all working correctly now. Thanks for your help AlgoTrader. |
| Post Reply |
| Thread Tools | |
| Display Modes | |
|
|