After login i was redirected a URL with session ID, i wasn't redirected to to the above URL. I assume, i should be able to get the request token programatically, by accessing the redirection url.
I am providing, api key, client ID (as userID) to get the login URL.After getting the login URL, i am making a connection request and hoping to get redirected to the redirection URL.But that doesn't happen.
For useId , i have tried both mail Id and client id, but still i am not able to get hold of access token.
Hi , If i understand right, I have to 1 . login manually to https://kite.zerodha.com/connect/login?api_key=XXXXXX 2. Which asks for client id and password, later security question 3 .On successful login, i will be able to capture the request token from the browser address bar (Manually) 4. later use the request token for any further interaction (programitacally) with the platform 5. Everytime the session expires, i should follow the steps 1 to 4 again
I have logged out of all platform.But still seems like i have to get the access token for every request. I get session expired after every request.Am i missing anything?
Hi, Like in .net do we have below kind of code in java which will set request_token automatically "Kite.Login() ‘Login to Kite using Web Browser. This library comes with a Web Browser control that will be used to Login and the Request token is automatically set.Client need not to copy the request token and set it manually."
Hello, I am using following method, it may help... 1. Every morning i login manually, and get the request token. 2. feed the token to my app, function called requestAccessToken, which return access token. 3. App will set access token for current section, also store access token to local storage for future use. 4. if my app restart, it will fetch access token from local storage, and get my margin , if get margin function success my access token is valid. if margin function throw error it will wait for new request token and as soon as get the request token step 1,2,3 will be repeated.
Thanks for the response, actually i am following the same steps but what's the use of automation then, if some network error occurs and session becomes invalid then again i have to follow the same steps manually. That's why i was looking for the solution. Have you handled for such situation or can any one give solution for this?
After successful login, you will be redirected to registered redirect url. In your case something like this http://127.0.0.1/?status=success&request_token=fqvqwkw9xgqavd0b2xn29kb08aqxdafd
Just copy request token and use it.
After login i was redirected a URL with session ID, i wasn't redirected to to the above URL.
I assume, i should be able to get the request token programatically, by accessing the redirection url.
Thanks
If you are looking at session id then you are not logged in. BTW you can only use client id which you have specified while creating App.
I am providing, api key, client ID (as userID) to get the login URL.After getting the login URL, i am making a connection request and hoping to get redirected to the redirection URL.But that doesn't happen.
For useId , i have tried both mail Id and client id, but still i am not able to get hold of access token.
If i understand right,
I have to
1 . login manually to https://kite.zerodha.com/connect/login?api_key=XXXXXX
2. Which asks for client id and password, later security question
3 .On successful login, i will be able to capture the request token from the browser address bar (Manually)
4. later use the request token for any further interaction (programitacally) with the platform
5. Everytime the session expires, i should follow the steps 1 to 4 again
Pls correct if the understanding is wrong.
Yes you are right. Your access token is valid for one day unless you use some other platform.
I get session expired after every request.Am i missing anything?
I am also facing the same thing, every request getting session expired.
Can any one reply
Once you fetch access token, store it somewhere and use the same. Don't request for access token every time you run App.
Like in .net do we have below kind of code in java which will set request_token automatically
"Kite.Login() ‘Login to Kite using Web Browser.
This library comes with a Web Browser control that will be used to Login and the Request token is automatically set.Client need not to copy the request token and set it manually."
I am using following method, it may help...
1. Every morning i login manually, and get the request token.
2. feed the token to my app, function called requestAccessToken, which return access token.
3. App will set access token for current section, also store access token to local storage for future use.
4. if my app restart, it will fetch access token from local storage, and get my margin , if get margin function success my access token is valid. if margin function throw error it will wait for new request token and as soon as get the request token step 1,2,3 will be repeated.
it is working for me without any error.
Thanks for the response, actually i am following the same steps but what's the use of automation then, if some network error occurs and session becomes invalid then again i have to follow the same steps manually. That's why i was looking for the solution. Have you handled for such situation or can any one give solution for this?
It is mandatory by the exchange that a trader has to log in manually at least once a day. Hence we don't recommend automating login.