You should get the access-token and refresh-token first time manually. Save it somewhere. Then automate the API call to get new access token periodically, e.g. every 24 days in your example. I have done similar procedure in automation workflows and it works.