authorization_error: USER_PERMISSION_DENIED

277 views
Skip to first unread message

Hubble App

unread,
Mar 17, 2021, 8:06:26 AM3/17/21
to AdWords API and Google Ads API Forum
Hello Team,

We are getting the below response from 1st March 2021 & before that it ran fine. We suspect this to be something related to token expiration (Please refer below logs).

Request: customer_id: "2900486729" 

 FYI : For sharing more details for access token etc., we don't have "reply to author privately" option to enabled.  

Logs: 
##########################
Method: /google.ads.googleads.v5.services.GoogleAdsService/Search
Host: googleads.googleapis.com:443
Headers: {
"developer-token": "REDACTED",
"login-customer-id": "2900486729",
"x-goog-api-client": "gl-python/3.9.0 grpc/1.33.2 gax/1.23.0 gapic/8.0.0",
"x-goog-request-params": "customer_id=2900486729"
}
Request: customer_id: "2900486729"
query: "SELECT\n\t campaign.name,\n\t campaign.id,\n\t campaign.status,\n\t ad_group.name,\n\t ad_group.id,\n\t ad_group.status,\n\t ad_group_ad.ad.id,\n\t ad_group_ad.ad.name,\n\t ad_group_ad.ad.image_ad.name,\n\t ad_group_ad.status,\n metrics.impressions,\n\t metrics.clicks,\n\t metrics.cost_micros,\n\t metrics.ctr,\n\t metrics.average_cpc,\n\t metrics.average_cost,\n\t metrics.average_cpm,\n\t segments.date,\n\t segments.device,\n\t segments.ad_network_type,\n \t segments.click_type\nFROM\n\tad_group_ad\nWHERE\n\tsegments.date BETWEEN \'2021-03-16\' AND \'2021-03-16\'"
page_size: 50

Response
-------
Headers: {
"google.ads.googleads.v5.errors.googleadsfailure-bin": "\n\u0001\n\u0002H\u0002\u0012\u0001User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid",
"grpc-status-details-bin": "\b\u0007\u0012#The caller does not have permission\u001a\u0002\nCtype.googleapis.com/google.ads.googleads.v5.errors.GoogleAdsFailure\u0012\u0002\n\u0001\n\u0002H\u0002\u0012\u0001User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid",
"request-id": "MQiYxhCMioS-s02kGyfz5g"
}
Fault: errors {
error_code {
authorization_error: USER_PERMISSION_DENIED
}
message: "User doesn\'t have permission to access customer. Note: If you\'re accessing a client customer, the manager\'s customer id must be set in the \'login-customer-id\' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid"
}

############


Best Regards,
Hubble App

Pavel Hegler

unread,
Mar 17, 2021, 9:12:03 AM3/17/21
to AdWords API and Google Ads API Forum
I had same issue and fixed it here. Pls take a look:)

Pavel Hegler

unread,
Mar 17, 2021, 9:18:33 AM3/17/21
to AdWords API and Google Ads API Forum
Sorry wrong link.
i mean here

Google Ads API Forum Advisor Prod

unread,
Mar 17, 2021, 7:24:54 PM3/17/21
to app.h...@nbcuni.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. I would recommend regenerating the OAuth2 credentials and obtaining a new refresh token using an email that has the proper access level for the target account. I noticed that the operating customer, 2900486729, is given in the login-customer-id header. If you are attempting to access the operating customer from an MCC, the MCC ID should be specified in the login-customer-id header. If you need further assistance, please send us an email at googleadsa...@google.com with a link to this thread.

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DwICp:ref

Hubble App

unread,
Mar 18, 2021, 2:38:26 PM3/18/21
to AdWords API and Google Ads API Forum
Hi Matt ,


Thank you for your response, as suggested we would first try to regenerate the OAuth2 credentials and obtain a new refresh token.

Could you please help us with STEPs to do same.

Regards,
Hubble App

Google Ads API Forum Advisor Prod

unread,
Apr 8, 2021, 10:11:57 AM4/8/21
to app.h...@nbcuni.com, adwor...@googlegroups.com
Hi,

My apologies for the delayed response.

If you want to regenerate the OAuth2 credentials and obtain a new refresh token, then you may refer to the following guides:
https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project
https://developers.google.com/google-ads/api/docs/first-call/refresh-token

Let me know if you have further questions and we will be happy to provide support.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DwICp:ref
Reply all
Reply to author
Forward
0 new messages