Hi Mary,
Thank you for reaching out to the Google Ads API support team.
If you use the
OAuth Playground to generate a refresh token, it will automatically revoke refresh tokens after 24h. Also, you may refer to this
document to read more information about refresh token expiration. If you set the publishing status to "Testing" so the refresh token expires every 7 days and receives an “
invalid_grant” error. That being said, please go to the Google API Console and navigate to the OAuth consent screen and then change the publishing status to “In production” to avoid the refresh
token expiring in 7 days.
By default, our
client libraries automatically refresh expired access tokens. You may refer to this guide on '
Fetch a refresh token', which uses the oauth2l command instead of curl to fetch the OAuth 2.0 refresh tokens. Another option for generating OAuth2 credentials is to use the
OAuth2 Playground. The OAuth2 Playground, in conjunction with the Google API Console, lets you manually create OAuth2 tokens.
I hope this helps! Let us know if you have any further questions.
