I took over this project from another developer (now no longer available to us) and recoded it, switching from the SOAP API to the REST API on Google Ads API. I found his config PHP and got the IDs I needed from there and continued using them. So, about 2 months ago I was using the Client ID, Client Secret, and Refresh Tokens that he had already generated. Everything was running perfectly for 2 months until the Refresh Token just expired for no reason at all. The doc you reference -- https://developers.google.com/identity/protocols/oauth2#expiration -- we checked each and every item mentioned there on why our Refresh Token may have expired and found no correlation. I found that the previous developer generated one with the Desktop app off of Github. I decided to create a new oAuth Client and set it as a Web Application instead. Then, I used the oAuth Playground to generate another Refresh ID. I then grabbed this new Client ID, Client Secret, and Refresh ID, and plugged it into my config PHP file, and sure enough I was generating access tokens again just fine and my offline conversions were working fine again.
We're just wondering how come the Refresh Token expired? How come the documentation didn't explain our particular case on why it expired? And I'm not certain because I don't have the previous developer to interact with on this, but will a Refresh Token last for, say, 2 years or more? Or, is there a limit (undocumented) on when that Refresh Token will finally expire? On Wed, Jul 27, 2022 at 1:38 AM Google Ads API Forum Advisor <adsapi@forumsupport.google> wrote: > Hi all, > > Thank you for getting back to us. I am Sherwin from Google Ads API and I > work with Anthony. I hope that you are doing well today. > > @all. The invalid_grant > <https://developers.google.com/google-ads/api/docs/best-practices/common-errors#invalid_grant> > usually > occurs if the refresh token is already expired and the usual reasons are > listed on this document > <https://developers.google.com/identity/protocols/oauth2#expiration>. Add > to that, 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. If the reason is already > identified and confirmed from the list of the said document, then that is > the time for a new refresh token by following the guide in the Youtube > video. If the publishing status of the Google Project has been reset to > "Testing", we highly suggest users to go to the Google API Console and > navigate to the OAuth consent screen. Then change the publishing status to > “In production” following these instructions > <https://support.google.com/cloud/answer/7454865> to avoid the refresh > token expiring in 7 days. > > Please let us know if you have other concerns or questions, we will be > happy to help. > > Kind regards, > [image: Google Logo] > Sherwin Vincent > Google Ads API Team > > > ref:_00D1U1174p._5004Q2cWRpu:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/CADcrBuzE8w_9UNGxzsncwV2zaKGYP4kOeLC_m9fy8Ctq8pOJsw%40mail.gmail.com.