the code generated after login is valid for how long? do i need to generate this code everytime i need to refresh my access token?
Please suggest how i can auutomate this whole process of generating access token through c++. I will be then connecting to v3 market data websocket for realtime symbol feeds. Please suggest the whole process for this. I need this explicitly in c++ please.
Valid till 3 am everyday. You need to regenerate after 3AM
Hi,
The access_token obtained through this API has a specific validity period that lasts until 3:30 AM the following day, regardless of the time it was generated. For instance, if you generate a token at 8 PM on Tuesday, it will expire at 3:30 AM on Wednesday. This also means that a token created at 2:30 AM on Wednesday will still expire at 3:30 AM on the same Wednesday. Therefore, users are advised to plan their activities accordingly, ensuring they accommodate the tokenās expiration schedule in their usage.
If you generate the access token in the morning, It will be valid for the whole day until 3:30 AM on next day.
so, does that mean i need a fresh code to be passed to the token api everytime i generate a new token? by code i mean the code generated on redirect url on login authorization?
- I generate a code through this api and then passes it to token api for creation of fresh token, āhttps://api.upstox.com/v2/login/authorization/dialog?client_id=cdefghijkl&redirect_uri=https%3A%2F%2Fxyz.com&state=1&response_type=codeā
the question here is do i need a fresh code everytime i generate a new token or the one single code is valid for multiple token creation?
so, does that mean i need a fresh code to be passed to the token api everytime i generate a new token? by code i mean the code generated on redirect url on login authorization?
- I generate a code through this api and then passes it to token api for creation of fresh token, āhttps://api.upstox.com/v2/login/authorization/dialog?client_id=cdefghijkl&redirect_uri=https%3A%2F%2Fxyz.com&state=1&response_type=codeā
the question here is do i need a fresh code everytime i generate a new token or the one single code is valid for multiple token creation?
@Sanjay_Jain i have shared a dummy api key, please read my question again. The login part is fine I just want to understand for how long the code returned from login api is valid for generating token?
Only once. Whenever you want to generate token, you need new code. Even if you need to generate token in next second. Code is one time use only
It is valid for 5 Minutes. Iāve tested it I generated the code and then I generated token after 4-5 minutes, it still works. But then it doesnāt work.
Thanks for the response. Can you please also suggest me how to automate the pin insertion on login api being done manuallly everytime in browser. Do we have a way to automate this, so that i donāt need to insert the pin in browser everytime.
Hi,
Please refer to my post: