Error 403 Forbidded when placing a bet (python)

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

    #1

    Error 403 Forbidded when placing a bet (python)

    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'])
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    I don't think the beta endpoints are valid anymore.

    You need to use the proper production endpoints - I think they are specified in the documentation.

    Comment

    Working...
    X