Small fix, the oauth2 and adwords are modules of googleads. (ok, to try it)

########################
import googleads

client_id = ' '
client_secret = ' '
refresh_token = ' '
company = ' '
client_customer_id = ' '

# or with:
#  googleads.oauth2._TOKEN_URL = 
'https://accounts.google.com/o/oauth2/token'
#  googleads.oauth2._GOOGLE_OAUTH2_ENDPOINT = 
'https://accounts.google.com/o/oauth2/auth'
oauth2_client = googleads.oauth2.GoogleRefreshTokenClient(client_id, 
client_secret, refresh_token)
adwords_client = googleads.adwords.AdWordsClient(None, oauth2_client, 
company, client_customer_id=client_customer_id)

report_downloader = adwords_client.GetReportDownloader(version='v201710')
########################


On Thursday, January 18, 2018 at 5:07:27 PM UTC+2, Alex Kashirin wrote:
>
> Hello,
> The following code is use to work with the adwords_client:
>
> ########################
> import googleads   
>     
> client_id = ' '
> client_secret = ' '
> refresh_token = ' '
> company = ' '
> client_customer_id = ' '
>
> # or with:
> #  oauth2._TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
> #  oauth2._GOOGLE_OAUTH2_ENDPOINT = '
> https://accounts.google.com/o/oauth2/auth'
> oauth2_client = oauth2.GoogleRefreshTokenClient(client_id, client_secret, 
> refresh_token)
> adwords_client = adwords.AdWordsClient(None, oauth2_client, company, 
> client_customer_id=client_customer_id)
>
> report_downloader = adwords_client.GetReportDownloader(version='v201710')
> ########################
>
> The googleads's oauth2_client is doing a token refresh as necessary and 
> the first request is the refresh that has the response code of 
> invalid_grant.
>
> What can be the reasons for the 'invalid_grant' error response ?
> client_id, client_secret and refresh_token should be the correct ones, as 
> give by client_secret_***.apps.googleusercontent.com.json
>
> Thanks,
> Kashirin Alex
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4f7f6651-ab94-4f53-b132-0dc56f4c9fb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Reasons for ... Alex Kashirin
    • Re: Rea... Alex Kashirin
    • Re: Rea... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum

Reply via email to