I am using Google Sheets for my website to store certain order information. The problem I'm dealing with is that the access_token expires within about an hour and the refresh_token lasts me a couple of days at most before it expires.
Once my refresh_token expires I have to:
The above process is manual, tedious and unbearable after a month.
Is there a better way?
The problem I'm dealing with is that the access_token expires within about an hour and the refresh_token lasts me a couple of days at most before it expires.
Refresh tokens only last seven days if your application is still in testing. Go to Google cloud console and set it to production. Your refresh token will then stop expiring.

I am using Google Sheets for my website to store certain order information.
If you are only using a sheet that you the developer control. This meaning that you are not accessing sheets owned by your users on their own google drive accounts. Then you should consider using a Service account. Should you be using a Google service account
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With