Hello,
I suddenly started receiving 403 Forbidden error when placing a bet programatically in Python via NG API.
The code was working for a while and since 2 weeks ago (roughly) I can't place any bet.
Can you help please?
My request look like this:
def placeBet(self, marketId, selectionId, side, size, price, cutomRef='myOrder'):
'''
side - either BACK or LAY
'''
if( marketId is not None and selectionId is not None):
print('Calling placeOrder for marketId :' + marketId + ' with selection id :' + str(selectionId))
place_order_Req = '{"marketId":"' + marketId + '","instructions":'\
'[{"selectionId":"' + str(
selectionId) + '","handicap":"0","side":"%s","orderType":"LIMIT", "limitOrder":{"size":"%s","price":"%s","persistenc eType":"LAPSE"}}],' \
'"customerRef":"%s"}' % (side, size, price, cutomRef)
endPoint = 'https://beta-api.betfair.com/rest/v1.0/placeOrders/'
place_order_Response = self._callAping2(place_order_Req, endPoint)
place_order_load = json.loads(place_order_Response)
print('Place order status is ' + place_order_load['status'])
print('Reason for Place order failure is ' + place_order_load['instructionReports'][0]['errorCode'])
I suddenly started receiving 403 Forbidden error when placing a bet programatically in Python via NG API.
The code was working for a while and since 2 weeks ago (roughly) I can't place any bet.
Can you help please?
My request look like this:
def placeBet(self, marketId, selectionId, side, size, price, cutomRef='myOrder'):
'''
side - either BACK or LAY
'''
if( marketId is not None and selectionId is not None):
print('Calling placeOrder for marketId :' + marketId + ' with selection id :' + str(selectionId))
place_order_Req = '{"marketId":"' + marketId + '","instructions":'\
'[{"selectionId":"' + str(
selectionId) + '","handicap":"0","side":"%s","orderType":"LIMIT", "limitOrder":{"size":"%s","price":"%s","persistenc eType":"LAPSE"}}],' \
'"customerRef":"%s"}' % (side, size, price, cutomRef)
endPoint = 'https://beta-api.betfair.com/rest/v1.0/placeOrders/'
place_order_Response = self._callAping2(place_order_Req, endPoint)
place_order_load = json.loads(place_order_Response)
print('Place order status is ' + place_order_load['status'])
print('Reason for Place order failure is ' + place_order_load['instructionReports'][0]['errorCode'])


Comment