Not able to automate authorization access token refresh

Hi,
I am not able to automate access token refresh.
I am calling https://api.upstox.com/v2/login/authorization/dialog api and was only able to manually enter otp , mobile number and password.
After this , I get the authorization code.
Using that I call https://api.upstox.com/v2/login/authorization/token and get my access token.
In this process, I was forced to daily do this step manually like manual login to get code.
Could u help me with this. Is there a way to automate this process using api. Or some other mechanism to only generate code once and refresh the token when its required. So no need to do manual login daily to get the code.

Thanks,
Snegha J