Insufficient permission for that call.

Akil
Akil edited May 8 in Python client
I am getting the following exception. what it means? How to proceed?
This is my code:
from kiteconnect import KiteConnect
from pprint import pprint
api_key = "your api key"
api_secret = "uw8w2eh8zymsssee5yykssaw7suylclqahz19zl"
kite = KiteConnect(api_key=api_key)
print(kite.login_url())
# data = kite.generate_session("ZH2rUgBasdfgaU7YiDd4VapO2ouEzgyiZ5JJ", api_secret)
# pprint(data)
kite.set_access_token("4Ru80BwnlMHasdfFXSd8UgN2D1JcigBj9EOJ")
pprint(kite.orders())
Traceback (most recent call last):
File "/home/blue/PycharmProjects/Kite/Log.py", line 10, in
pprint(kite.orders())
File "/home/blue/PycharmProjects/Kite/venv/lib/python3.8/site-packages/kiteconnect/connect.py", line 399, in orders
return self._format_response(self._get("orders"))
File "/home/blue/PycharmProjects/Kite/venv/lib/python3.8/site-packages/kiteconnect/connect.py", line 817, in _get
return self._request(route, "GET", params)
File "/home/blue/PycharmProjects/Kite/venv/lib/python3.8/site-packages/kiteconnect/connect.py", line 886, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.PermissionException: Insufficient permission for that call.

Process finished with exit code 1
  • sujith
    It is strongly advised not to expose any kind of app tokens or user-specific tokens on public threads. If you have to then you can private message us.

    You seem to be re-using the request token which is not right. I would suggest looking at this thread and modifying your code.

    If you still have an issue then post the complete stack trace here by removing the session and user tokens.

    Make sure to use it for the only for the user with which the Kite Connect app is created.
  • Akil
    thanks bubby
This discussion has been closed.