Invalid Request Token

kcbhushan
Even though I am following the login process as per the Kite API, I am getting invalid request token. Here is the trace.

return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params)
File "***(blanked out)", line 918, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.TokenException: Token is invalid or has expired.
  • kcbhushan
    Please note that after login I am indeed able to get a request token which I am immediately using in the generate_session call.
  • SRIJAN
    SRIJAN edited August 2022
    A request token is valid only for a couple of minutes,after that it expires.

    You won't get this error unless you are using incorrect request token.

    Also, make sure to pass api_key/api_secret/request token/access token as strings.
Sign In or Register to comment.