We run a cron job that runs every 30 minutes because we need to fetch data from infusionsoft api. The token are stored in a json file along with the expire time of the access token. The script checks if token has expired ie compares unix timestamp of the token validity and current timestamp.
If expired makes request for new token. And stores new access token and refresh token for future use along with a future expiring timestamp. This works for 3/4 days and max 1 week and suddenly the token are not renewed anymore.
Does anyone know why this is happening?