Using all correct keys api_key, api_secrete, user_id, and requestToken.
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:4 43 DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTT P/1.1" 403 None Traceback (most recent call last): File "get_request_token.py", line 19, in access_token = kite.generate_session(kite.login_url(), api_secret=api_secret ) File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac kages\kiteconnect\connect.py", line 252, in generate_session "checksum": checksum File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac kages\kiteconnect\connect.py", line 821, in _post return self._request(route, "POST", params) File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac kages\kiteconnect\connect.py", line 886, in _request raise exp(data["message"], code=r.status_code) kiteconnect.exceptions.TokenException: Token is invalid or has expired.
I have read all the relevant discussion but nothing helpful, I can send API keys, secrets separately. This app newly created few days back, please help.
@sujith , This is a wrong thread as here it is talking about an access token which gets generated and then expires. For me, it is not even getting generated for a new api_secret created on that day. Please help me [email protected].
I was facing the same issue (invalid checksum) after my API subscription got expired yesterday. Regenerating the API secret and using it in code solved it for me.
@sujith, While trying to follow the documentation, I am getting the error while running the /session/token API. It is giving an 400 error (Bad request) that the 'api_key' should be minimum 6 characters in length, so token is not getting generated.
getting flowing error
Array ( [status] => error [message] => Invalid `checksum`. [data] => [error_type] => TokenException )
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:4
43
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTT
P/1.1" 403 None
Traceback (most recent call last):
File "get_request_token.py", line 19, in
access_token = kite.generate_session(kite.login_url(), api_secret=api_secret
)
File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac
kages\kiteconnect\connect.py", line 252, in generate_session
"checksum": checksum
File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac
kages\kiteconnect\connect.py", line 821, in _post
return self._request(route, "POST", params)
File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python37-32\lib\site-pac
kages\kiteconnect\connect.py", line 886, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.TokenException: Token is invalid or has expired.
I have read all the relevant discussion but nothing helpful, I can send API keys, secrets separately.
This app newly created few days back, please help.
Double check if you are doing every step properly.