I have had the same issue saving the refresh token such that it does not expire to solve this you need to make table in db save the token then setup a cronjob for every hour to refresh the token use system cron instead of wordpress as it will be a little more relaible if you have diffculties you can follow this guide https://www.wpscreators.com/simple-wordpress-custom-constant-contact-api/
... View more