Permission exception with cdsl authorization

sukrit1990
Hi, I am trying to run the following code. I have the api subscription and I get the correct response for the fnm2 call. But fnm1 gives me permission exception. Does anyone know why ?


baseurl = 'https://api.kite.trade'
auth = 'token '+api_key+':'+acs_tok
headers = {'X-Kite-Version':'3','Authorization': auth}
fnm = '/portfolio/holdings/authorise'
fnm2 = '/portfolio/positions'
fum_url = baseurl+fnm
fum_url2 = baseurl+fnm2
fum_req = requests.post(fum_url, headers=headers)
print(fum_req.json())
fum_req2 = requests.get(fum_url2, headers=headers)
print(fum_req2.json())


Result -
{u'status': u'error', u'message': u'Insufficient permission for that call.', u'error_type': u'PermissionException', u'data': None}
{u'status': u'success', u'data': {u'net': [], u'day': []}}
  • rakeshr
    {u'status': u'error', u'message': u'Insufficient permission for that call.', u'error_type': u'PermissionException', u'data': None}
    Are you following the correct holdings authorization flow as mentioned here?
  • sukrit1990
    Yes, I am following this flow. But I keep getting the "Insufficient permission" error. I don't get this error for the portfolio/positions API (as shown in the code above)
  • sujith
    @sukrit1990,
    You need to go to the Kite web or app and pre-authorize the holdings. A Kite Connect app doesn't have the permission to authorize holdings on CDSL.
Sign In or Register to comment.