attribute error for access token

a4arjun
AttributeError: 'KiteConnect' object has no attribute 'request_access_token
this message is popping up every time when i request access token ...pls someone help me with this
  • sujith
    @a4arjun,
    Where did you see this method?
  • a4arjun
    on profit adda youtube channel
  • sujith
    It is a very old version of Kite Connect. The new one has generate_session method.
    You can check out pykiteconnect documentation here for more information.
  • a4arjun
    with generate_session method ...it is showing as below


    File "", line 1, in
    data = kite.generate_session("Kpq6mZ6oUZvNjUgllOlRKV4VYRnNyfGn", api_secret)

    File "C:\Users\Arjun\Anaconda3\lib\site-packages\kiteconnect-3.7.7-py3.7.egg\kiteconnect\connect.py", line 232, in generate_session
    "checksum": checksum

    File "C:\Users\Arjun\Anaconda3\lib\site-packages\kiteconnect-3.7.7-py3.7.egg\kiteconnect\connect.py", line 701, in _post
    return self._request(route, "POST", params)

    File "C:\Users\Arjun\Anaconda3\lib\site-packages\kiteconnect-3.7.7-py3.7.egg\kiteconnect\connect.py", line 766, in _request
    raise exp(data["message"], code=r.status_code)

    TokenException: Token is invalid or has expired.
  • sujith
    You can take a look at this thread.
  • a4arjun
    thanks friend for ur advice ...but now when i am going throuh generate session method ..it is showing this

    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 200 None
  • sujith
    @Imran,
    Can you please let us know the fix here? I think you had resolved a similar issue recently.
Sign In or Register to comment.