New app - token invalid or expired

I got the request token following the documented steps from browser. I used it to get access token by calling renewAccessToken.
I receive the following message in exception:

"Token is invalid or has expired." with code 403
  • sujith
    You need to use generateAccessToken and not renewAccessToken.
  • ragural
    ragural edited November 2019
    I having same problem. I created new app today and followed the documentation to create request token. I am getting request token on the browser. but when I run default program

    I used following for getting started sample.
    I am trying to generate my token from but it always says "
    kiteconnect.exceptions.TokenException: Token is invalid or has expired."

    Please help. here is my code

    kite = KiteConnect(api_key=api_key)
    data = kite.generate_session(request_token, api_secret=api_secret)

  • rakeshr
    Can you re-check that you are using correct api_secret as mentioned on kite connect dev page?
  • ragural
    hi @rakeshr

    Thanks for your response. I just rechked.. My api_key was wrong. Now it is working..

This discussion has been closed.