Refresh Token expires after 7 days

134 views
Skip to first unread message

Philipp Sowinski

unread,
Sep 3, 2021, 5:02:26 PM9/3/21
to AdWords API and Google Ads API Forum
Hi,

I want to run a cron task which uploads offline conversions every day.
Unfortunately my refresh token expires after 7 days.

What can I do?

This is the error message I get
"google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})"

I am sure, there must be a permanent way?

Thank you
Philipp

Google Ads API Forum Advisor

unread,
Sep 6, 2021, 11:47:24 PM9/6/21
to philipp....@gmail.com, adwor...@googlegroups.com

Hi Philipp,

Thanks for reaching out to us.

You may refer to this document to read more information about refresh token expiration. Since you mentioned that the refresh token expires after 7 days, then it appears that the scenario below is happening at your end.

"A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days."

As 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.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2MlSmG:ref
Reply all
Reply to author
Forward
0 new messages