I have activated my previously expired app. I am trying to login through python code but getting below error in kite.generate_session:
Exception has occurred: TokenException Token is invalid or has expired. 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" 403 None
MY CODE: import logging from kiteconnect import KiteConnect
logging.basicConfig(level=logging.DEBUG)
kite = KiteConnect(api_key="my api key") print(kite.login_url()) request_token_here = str(input()) #manually copy the login_url() and paste it to browser and copy the request token and input as a request_token_here data = kite.generate_session("request_token_here", api_secret="my api secret") kite.set_access_token(data["access_token"])
import logging
from kiteconnect import KiteConnect
logging.basicConfig(level=logging.DEBUG)
kite = KiteConnect(api_key="my api key")
print(kite.login_url())
request_token_here = str(input())
#manually copy the login_url() and paste it to browser and copy the request token and input as a request_token_here
data = kite.generate_session("request_token_here", api_secret="my api secret")
kite.set_access_token(data["access_token"])