Hi Serena,

Thanks for reaching out to the Google Ads API Forum.

Since you mentioned that the token expires every two weeks and you have to go 
through the process again in the playground, can you confirm if your OAuth App 
is already verified?

For information on OAuth Verification, and how to verify your projects, please 
refer to the below links:

How to verify: OAuth API verification FAQs - Google Cloud Platform Console Help

General information: Unverified apps - Google Cloud Platform Console Help


If you leave the project unverified, you will see an unverified warning when 
you authenticate and your project will be subject to an OAuth user quota. If 
your App is verified, and used this code example to generate a refresh token, 
then the refresh token should not expire within 7 days.

As you shared, you may also refer to this document to read more information 
about refresh token expiration. There is currently a limit of 100 refresh 
tokens per Google Account per OAuth 2.0 client ID. If the limit is reached, 
creating a new refresh token automatically invalidates the oldest refresh token 
without warning.

In addition, I had to delete your post as it contained sensitive information. 
You may see below for your reference:

“Hello,

I'm working for a customer that have ads campaigns that I extract each day from 
Google Ads API with a scheduled trigger.

The steps I have done to have the access to the data are the following:


1. I refresh the refresh token in OAuth 2.0 Playground (google.com) page by 
adding the scope for GoogleAds (https://www.googleapis.com/auth/adwords)

2. I use the next config:


3. Then, I get that refresh token response and use it to do POST request and 
get the access token ready to extract data:


4. I get the access token from response and then do POST request to 
https://googleads.googleapis.com/v12/customers/{customerID}/googleAds:searchStream?
 using query as Body and the Content-Type (application/json) and Authorization 
(Bearer token) as additional headers.


The data is extracted correctly and everything is fine, but the token expires 
every two weeks and I have to go through the process again in playground.

What do I have to take into account so that this refresh_token does not expire 
after two weeks?

The response after two weeks is :



The project doesnt have Test publish status, we have consent screen configured 
for external user type and the publishing status is on Production.


The project ID is GTM-KQ786MW , maybe you can check it to help me have a 
solution.

Thank you so much.


Regards,

Serena.

“


Regards,

Yasar
Google Ads API Team
ref:_00D1U1174p._5004Q2j0sTE: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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/meaO2000000000000000000000000000000000000000000000RQ6TMR00x2y7hYRmQYCJirUgi7zKxA%40sfdc.net.

Reply via email to