insufficient privileges

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • betanator
    Junior Member
    • Jul 2014
    • 4

    #1

    insufficient privileges

    Dear developers,
    Am looking to use the placeOrder method of the API NG but am getting an exception as below.

    Any suggestions on what may be causing this?
    Possibly the application ID? Though I can run the list methods and login ok.

    Not sure, it is probably something simple, but am stuck on it!
    Thanks in advance for your help.

    Request:
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/placeOrders", "params": {"marketId":"1.114579553","instructions":[{"selectionId":"699743","handicap":"0","side":"BAC K","orderType":"LIMIT","limitOrder":{"size":"5.0", "price":"2.16","persistenceType":"LAPSE"}}],"customerRef":"testback12"}, "id": 1}
    https://api.betfair.com/exchange/betting/rest/v1.0/placeOrders/{"marketId":"1.114402505","instructions":[{"selectionId":8484249,"side":"BACK","orderType":" LIMIT"," limitOrder":{"persistenceType":"PERSIST","price":3 .6,"size":4.0}}]}

    Response:
    Exception from API-NG{u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'ANGX-0009', u'code': -32099, u'data': {u'exceptionname': u'APINGException', u'APINGException': {u'errorDetails': u'INSUFFICIENT_PRIVILEGES', u'errorCode': u'SERVICE_BUSY', u'requestUUID': u'prdang004-07021100-001bd33a80'}}}}
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    If that is the single request string then I'm not sure it makes any sense. It seems to be a mix of RPC and REST.

    Why not start with a single bet on a single market?

    Comment

    • betanator
      Junior Member
      • Jul 2014
      • 4

      #3
      apologies it should read just as a JSON-RPC request

      req = urllib2.Request(url, jsonrpc_req, header)
      url = "https://api.betfair.com/exchange/betting/json-rpc/v1"
      header = {'X-Application': appKey, 'X-Authentication': sessionToken, 'content-type': 'application/json'}

      jsonrpc_req:
      {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/placeOrders", "params": {"marketId":"1.114579543","instructions":[{"selectionId":"8669329,"handicap":"0","side":"BAC K","orderType":"LIMIT","limitOrder":{"size":"5.0", "price":"29.0","persistenceType":"LAPSE"}}],"customerRef":"testback12"}, "id": 1}


      now the error i receive when trying to call the placeOrders methods is:
      no service available at https://api.betfair.com/exchange/betting/json-rpc/v1
      response code 400 (bad request)?

      any ideas?

      many thanks

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        Looks like you are treating some numeric values as strings.

        Items like size, price, selectionId, handicap are all numeric and therefore should not be "quoted" in the request.

        Comment

        • Javeid_UK_2.
          Junior Member
          • Jul 2014
          • 5

          #5
          Also, what is that decimal value used as market id? It should be an integer.

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #6
            The marketId is correct.

            In the new API, all marketIds are strings like "1.xxx" or "2.xxx" where the initial 1 or 2 denotes the exchange that the market is on.

            Comment

            • betanator
              Junior Member
              • Jul 2014
              • 4

              #7
              Thanks for the tips and feedback so far, it has helped me work through a few things. After making those adjustments to the request, i now get a response ACCESS_DENIED as below:

              Request: {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/placeOrders", "params": {"marketId":"1.113659986","instructions":[{"selectionId":55190,"handicap":0,"side":"BACK","o rderType":"LIMIT","limitOrder":{"size":5.0,"price" :3.2,"persistenceType":"LAPSE"}}],"customerRef":"testback12"}, "id": 1}


              Response: {"jsonrpc":"2.0","error":{"code":-32099,"message":"ANGX-0015","data":{"exceptionname":"APINGException","AP INGException":{"errorDetails":"","errorCode":"ACCE SS_DENIED","requestUUID":"prdang007-07141523-0000319fd8"}}},"id":1}

              any direction from here would be greatly appreciated.
              Cheers.

              Comment

              • betdynamics
                Junior Member
                • Sep 2010
                • 534

                #8
                That suggests that you are not sending the correct AppKey in your request header.

                Comment

                • betanator
                  Junior Member
                  • Jul 2014
                  • 4

                  #9
                  Thanks for all the support, have updated the app key and now can run the placeOrders method successfully.

                  I was using the delay key instead of the normal app key.

                  Cheers.

                  Comment

                  Working...
                  X