After followed Quickstart
<https://developers.google.com/google-ads/api/docs/start> guide, I'm still
meeting the same error, here's my trial:
# 1) got specified credentials
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
CLIENT_SECRETS_FILE, scopes=SCOPES, state=state)
flow.redirect_uri = REDIRECT_URL
authorization_response = REQUEST_URL
flow.fetch_token(authorization_response=authorization_response)
# Store credentials
credentials = flow.credentials
# the credentials is like
credentials_dict = \
{'token': 'xITMxxQCxxxx8wM3VIeG0',
'client_secret': 'L3xd7ioxD',
'scopes': ['https://www.googleapis.com/auth/adwords'],
'refresh_token': 'xcZoxxxxxxxxx8',
'token_uri': 'https://oauth2.googleapis.com/token',
'client_id': '7xogleuserconxxt.coxm'}
...
# 2) got an adsclient using credentials
credentials = google.oauth2.credentials.Credentials(credentials)
adsclient = google.ads.google_ads.client.GoogleAdsClient(
credentials, developer_token)
# 3) do different service by client
customer_service = adsclient.get_service('CustomerService', version='v2')
customers = customer_service.list_accessible_customers()
print(customers)
same error happend when tring to list all customers
google.ads.google_ads.errors.GoogleAdsException: (<_Rendezvous of RPC that
terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential.
Expected OAuth 2 access token, login cookie or other valid authentication
credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string =
"{"created":"@1566544852.226886110","description":"Error received from peer
ipv4:17d.1d:443","file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"Request
is missing required authentication credential. Expected OAuth 2 access token,
login cookie or other valid authentication credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, <_Rendezvous of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential.
Expected OAuth 2 access token, login cookie or other valid authentication
credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string =
"{"created":"@1566544852.226886110","description":"Error received from peer
ipv4:1dd:4d3","file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"Request
is missing required authentication credential. Expected OAuth 2 access token,
login cookie or other valid authentication credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, errors {
error_code {
authentication_error: AUTHENTICATION_ERROR
}
message: "Authentication of the request failed."
}
, 'IOPV3IUx7wLHzHQbbEH6WQ')
Can you help me about my problem?
在 2019年8月23日星期五 UTC+8上午4:51:26,adsapiforumadvisor写道:
>
> Hi Jia,
>
> Thank you for reaching support. With regards to your concern, it looks
> like you have sent invalid authentication credentials while making call to
> API. This is the reason you are getting StatusCode.UNAUTHENTICATED error.
> Could you please verify if the correct credentials are used while making
> API call. You might find our Quickstart
> <https://developers.google.com/google-ads/api/docs/start> guide useful
> for the process of acquiring the correct set of credentials needed to make
> call to the API. Let us know if you are still facing issue.
>
> Regards,
> Nikisha Patel, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UHEN2K: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
"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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/7de962d7-08c3-4efc-adc3-6bdfb682caaa%40googlegroups.com.