Hi guys I am unable to get the access token for my app in python. This is my first app on kite connect, and I am also new to coding. I checked the documentation and tried to following the instructions but am getting stuck here, so would appreciate the help.
The document says in order to get the access token we have to:
POST the api_key, request_token and checksum (SHA-256 of api_key + request_token + api_secret) to /session/token
I am getting errors again and again, so here are my questions: 1. Whats the best way to calculate the checksum here? Do I have to concatenate the api_key, request_token and api_secret into one string and then find the checksum of the combined string 2. Can I calculate this checksum in python, whats the code for it 3. Are the entire 5 lines of code starting with curl https://... above to be pasted exactly as they are shown above? Is this to be done in python or in the main terminal after exiting from python?
Thanks, but I am just not able to go past this step - I am doing something wrong in generating a session I think, but am not sure. Here is what I get in my terminal if I try to run the script step by step and reach this command and press enter: data = kite.generate_session(request_token, api_secret=api_secret)
If you're talking of the data that the server sends if the script works well, (name, exchanges the user has access, access token etc), no I didnt get that. I just got the error messages above
pykiteconnect does it for you. You can check out the repo here.
EBUG: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" 200 None
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
403 Forbidden
data = kite.generate_session(request_token, api_secret=api_secret)
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" 200 None