If it helps, here's the detailed logging output for a failed request.  I 
executed the same query via REST and it worked perfectly.

GoogleAds.DetailedRequestLogs Information: 1 : [2021-08-04 18:43:25Z] - 
---------------BEGIN API CALL---------------

Request
-------

Method Name: /google.ads.googleads.v8.services.GoogleAdsService/SearchStream
Host: https://googleads.googleapis.com
Headers: {
  "x-goog-api-client": "gl-dotnet/5.0.0 gapic/9.0.0 
gax/3.2.0+002f6637d17e4170f5db7ec7ca6f0163e6df1481 grpc/2.36.4",
  "developer-token": "REDACTED",
  "login-customer-id": "2165426251",
  "linked-customer-id": "1460046398",
  "x-goog-request-params": "customer_id=1460046398"
}

{ "customerId": "1460046398", "query": "SELECT campaign.id, campaign.name, 
campaign.network_settings.target_content_network FROM campaign ORDER BY 
campaign.id", "summaryRowSetting": "NO_SUMMARY_ROW" }

Response
--------
Headers: {
  "request-id": "ZcqyoDt7yF_vLSqmqC4GpQ",
  "date": "Wed, 04 Aug 2021 18:43:23 GMT",
  "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; 
ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; 
ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; 
ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
  "google.ads.googleads.v8.errors.googleadsfailure-bin": 
"Cv8BCgJIAhL4AVVzZXIgZG9lc24ndCBoYXZlIHBlcm1pc3Npb24gdG8gYWNjZXNzIGN1c3RvbWVyLiBOb3RlOiBJZiB5b3UncmUgYWNjZXNzaW5nIGEgY2xpZW50IGN1c3RvbWVyLCB0aGUgbWFuYWdlcidzIGN1c3RvbWVyIGlkIG11c3QgYmUgc2V0IGluIHRoZSAnbG9naW4tY3VzdG9tZXItaWQnIGhlYWRlci4gU2VlIGh0dHBzOi8vZGV2ZWxvcGVycy5nb29nbGUuY29tL2dvb2dsZS1hZHMvYXBpL2RvY3MvY29uY2VwdHMvY2FsbC1zdHJ1Y3R1cmUjY2lkEhZaY3F5b0R0N3lGX3ZMU3FtcUM0R3BR",
  "grpc-status-details-bin": 
"CAcSI1RoZSBjYWxsZXIgZG9lcyBub3QgaGF2ZSBwZXJtaXNzaW9uGuICCkN0eXBlLmdvb2dsZWFwaXMuY29tL2dvb2dsZS5hZHMuZ29vZ2xlYWRzLnY4LmVycm9ycy5Hb29nbGVBZHNGYWlsdXJlEpoCCv8BCgJIAhL4AVVzZXIgZG9lc24ndCBoYXZlIHBlcm1pc3Npb24gdG8gYWNjZXNzIGN1c3RvbWVyLiBOb3RlOiBJZiB5b3UncmUgYWNjZXNzaW5nIGEgY2xpZW50IGN1c3RvbWVyLCB0aGUgbWFuYWdlcidzIGN1c3RvbWVyIGlkIG11c3QgYmUgc2V0IGluIHRoZSAnbG9naW4tY3VzdG9tZXItaWQnIGhlYWRlci4gU2VlIGh0dHBzOi8vZGV2ZWxvcGVycy5nb29nbGUuY29tL2dvb2dsZS1hZHMvYXBpL2RvY3MvY29uY2VwdHMvY2FsbC1zdHJ1Y3R1cmUjY2lkEhZaY3F5b0R0N3lGX3ZMU3FtcUM0R3BR"
}

Fault: {
  "StatusCode": 7,
  "Details": "The caller does not have permission",
  "RequestId": "ZcqyoDt7yF_vLSqmqC4GpQ",
  "Failure": {
    "errors": [
      {
        "errorCode": {
          "authorizationError": "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";
      }
    ],
    "requestId": "ZcqyoDt7yF_vLSqmqC4GpQ"
  }
}
----------------END API CALL----------------



On Wednesday, August 4, 2021 at 2:24:05 PM UTC-4 jlw2...@gmail.com wrote:

> I'm having trouble getting the GoogleAds API c# library to work but the 
> REST endpoints are working just fine.
>
> I have one MMC account which has access to one client account.
>
>   o  LoginCustomerId: 2165426251 <(216)%20542-6251> (MMC Account)
>   o  LinkedCustomerId: 1460046398 (client Ads account)
>
> When I use the ListAccessibleCustomers() method from 
> Services.V8.CustomerService, the response indicates the API user has access 
> to:
>
>   "customers/1460046398, customers/2165426251 <(216)%20542-6251>"
>
> Any library method I've tried using Services.V8.GoogleAdsService, however, 
> fails with the following message:
>
> Status(StatusCode="PermissionDenied", Detail="The caller does not have 
> permission", DebugException="Grpc.Core.Internal.CoreErrorDetailException: 
> {"created":"@1628100271.325000000","description":"Error received from peer 
> ipv4:172.217.8.138:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1068,"grpc_message":"The
>  
> caller does not have permission","grpc_status":7}")
>
> A recent request id is:
>    Request ID: mIixcjIUMVtxWOm_Ccntxw 
>
> I am able to run search queries against this account using the SAME Oauth 
> credentials and the REST endpoint as follows:
>
> REQUEST URL: 
> https://googleads.googleapis.com/v8/customers/1460046398/googleAds:searchStream
>
> HEADERS: 
>          Authorization: "Bearer [redacted]"
>  developer-token: "[redacted]"
>  login-customer-id: "2165426251 <(216)%20542-6251>"
>
> QUERY: SELECT ad_group.ad_rotation_mode, ad_group.id, ad_group.name, 
> ad_group.status, ad_group.type, campaign.id, campaign.name, 
> metrics.impressions, metrics.clicks, metrics.cost_micros, 
> metrics.conversions , segments.ad_network_type, segments.device, 
> metrics.top_impression_percentage, 
> metrics.absolute_top_impression_percentage FROM ad_group WHERE 
> ad_group.status != 'REMOVED' AND segments.date >= '2021-08-03' AND 
> segments.date < '2021-08-04' 
>
> What magic am I missing that's required to make the grpc GoogleAdsService 
> library methods work?
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/e65ce765-511f-4485-8ab4-de8fb2b73672n%40googlegroups.com.

Reply via email to