Hi all,

<https://stackoverflow.com/posts/66138931/timeline>

I've set up the whole Google Ads API according to this manual here: 
https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-desktop?hl=en

I got my refresh token and put it in my google-ads.yaml file which looks 
exactly like this: 
https://github.com/googleads/google-ads-python/blob/master/google-ads.yaml. 
I also put my client_id, developer_token and client_secret at the 
corresponding spots in the file.

Everything worked out and I tried an example to  get forecast metrics of 
few keywords campaigns: 
https://developers.google.com/google-ads/api/docs/keyword-planning/generate-forecast-metrics
 
<https://developers.google.com/google-ads/api/docs/samples/get-campaigns#python>.
 
Also I could use other services of the API.

Each time I use the API I access it via the client using the following code:
from google.ads.google_ads.client import GoogleAdsClient 
client = GoogleAdsClient.load_from_storage(path_to_google_ads_yaml_file)

As I already said it worked.

A few days later I tried to connect again and I got the following error:

google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', 
{'error': 'invalid_grant', 'error_description': 'Bad Request'})

So I did the process of getting a new refresh token again (
https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-desktop?hl=en)
 
such that everything worked out again.

One day later I got the same error again.  Please someone suggest me the 
reason for this error.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads 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/ff5a43d0-71d5-4231-a8e9-5636333bf70bn%40googlegroups.com.

Reply via email to