Hi I am trying to generate acess token . Getting the below error : 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 kiteconnect.exceptions.TokenException: Invalid `checksum`.
My code is
import logging from kiteconnect import KiteConnect
As stated in the error message,your checksum is invalid. Your api_key and api_secret are literally 'key' and 'secret'. Try with the actual api_key and api_secret provided when making an app on the developer console.
It will work properly.
After getting the access token . how will I initiate the kite in with out asking/regenerating the request token
i am using
kite = KiteConnect(api_key=api_key,access_token= access_token)
Getting Error
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /instruments HTTP/1.1" 200 1326165
Thank you
Status code 200 means your request was successful.
Refer the sample code on GitHub here:
https://github.com/zerodha/pykiteconnect#api-usage
You don't need to generate request_token and then access_token for each session. This is only needed once each day when you login.
An access token is valid for one whole day(till 6 AM next day). After generating access token,you can save it in your local database.
And use set_access_token as shown in the documentation ,or directly pass the access token when initializing Kite object as you are doing currently.
Read more about login flow here:
https://kite.trade/docs/connect/v3/user/