Hi Nikhil,
My apologies for the delayed response. To answer your concern in this thread
<https://groups.google.com/d/msgid/adwords-api/402684c3-4c39-4a05-9278-8bd0b091d425%40googlegroups.com>,
if you are making calls against your production account, then yes, the OAuth2
Credentials
<https://developers.google.com/adwords/api/docs/guides/authentication> has
to be setup by the same email used in your production MCC account.
Based on your logs, it seems that the credentials are not detected by the
API. Could you confirm if you have inputted your OAuth2 Credentials and
other information in the yaml file? If not, kindly input the credentials in
their respective fields in the yaml file then you may try to call the
service again.
If this still does not work, could you provide the complete SOAP request
and response logs that were generated so that I could investigate this
further? You may provide complete the logs via *Reply privately to author*.
Regards,
Dannison
AdWords API Team
On Saturday, September 29, 2018 at 4:12:36 AM UTC+8, nikhil almeida wrote:
>
> I have tried configuring the yaml file and getting the constructor by
> loading from storage while also the method below.
> But I keep getting the following error. Can some one please help?
>
> [2018-09-27 17:02:52,326 - googleads.soap - WARNING] Error summary:
> {'faultMessage': "[AuthenticationError.OAUTH_TOKEN_INVALID @ ;
> trigger:'<null>']", 'requestId': '000576e32d3d31000aa37e521e0075d1',
> 'serviceName': 'CustomerService', 'methodName': 'getCustomers', 'operations':
> '0', 'responseTime': '20'}
>
> ....
>
>
> GoogleAdsServerFault: [AuthenticationError.OAUTH_TOKEN_INVALID @ ;
> trigger:'<null>']
>
>
>
>
> GOOGLE_OAUTH2_ENDPOINT = 'https://accounts.google.com/o/oauth2/token'
>
> # OAuth2 credential information.
> DEFAULT_CLIENT_ID = 'INSERT_CLIENT_ID_HERE'
> DEFAULT_CLIENT_SECRET = 'INSERT_CLIENT_SECRET_HERE'
> DEFAULT_REFRESH_TOKEN = 'INSERT_REFRESH_TOKEN_HERE'
> # AdWords API information.
> DEFAULT_CLIENT_CUSTOMER_ID = 'INSERT_CLIENT_CUSTOMER_ID_HERE'
> DEFAULT_DEVELOPER_TOKEN = 'INSERT_DEVELOPER_TOKEN_HERE'
> USER_AGENT = 'INSERT_USER_AGENT_HERE'
>
> oauth2credentials = client.OAuth2Credentials(
> None, DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET,
> DEFAULT_REFRESH_TOKEN,
> datetime.datetime(1980, 1, 1, 12), GOOGLE_OAUTH2_ENDPOINT,
> USER_AGENT)
>
> oauth2credentials.refresh(httplib2.Http())
>
> oauth2_client =
> oauth2.GoogleAccessTokenClient(oauth2credentials.access_token,
> oauth2credentials.token_expiry)
>
>
> adwords_client = adwords.AdWordsClient(
> DEFAULT_DEVELOPER_TOKEN, oauth2_client, USER_AGENT,
> client_customer_id=DEFAULT_CLIENT_CUSTOMER_ID)
>
> customer = adwords_client.GetService('CustomerService').getCustomers()[0]
> print(f"You are logged in as {customer['customerId']}")
>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads 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/fc4bee1e-54e2-4a83-b0f2-381bdcb271a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.