I’ve been having a persistent issue with my client’s access and refresh tokens expiring/refreshing on their own and I’m not entirely sure if it’s an issue on my end or an issue on the API’s end.
From the research I’ve done, the access and refresh tokens for newly-created APIv2 clients should now be permanent and not need refreshing. Despite my APIv2 client being created in Oct '19, my access/refresh tokens continually expire after 30 days.
When I first noticed the issue, I wrote a cron function to auto-refresh the access/refresh tokens once a week. Despite the scheduled refreshes, the tokens refreshed automatically after 30 days and invalidated the newest refresh token. This caused the need to contact my project manager to manually refresh the campaign’s tokens.
After that issue, I rewrote the cron function to refresh the tokens when their expiration date occurred. Again, the tokens refreshed automatically and invalidated my client’s stored tokens and, again, my project manager had to manually refresh the campaign’s tokens.
I’m not entirely sure what to do here. Manually having the tokens refreshed monthly is not ideal and I’d like to keep the authentication renewal process as automated as possible. If anyone has any solution or insight on this issue, it would be much appreciated.