Re: google ads api authrization, permission error

2024-03-13 Thread Jian Hu
Hi,

Thanks for you reply.

Juste infos: I use a PHP library official : 
https://github.com/googleads/google-ads-php

I test a sample with this url: 
https://github.com/googleads/google-ads-php/blob/main/examples/AccountManagement/GetChangeSummary.php

I understand my test request missed " *login-customer-id* ", but how can I 
add this "login-customer-id" in request ?
Could you check this example and tell me where I need to add " 
*login-customer-id* " ?
Your example never use this parameter.

Thanks again for your reply.




I copy my request:

**
 

Request
**
 


Method Name: 
/google.ads.googleads.v16.services.GoogleAdsService/SearchStream

Host: googleads.googleapis.com

Headers: {

"x-goog-api-client": "gl-php\/8.2.15 gccl\/22.1.0 gapic\/22.1.0 
gax\/1.30.0 grpc\/1.60.0 rest\/1.30.0 pb\/+n",

"User-Agent": "gcloud-php-new\/22.1.0",

"x-goog-request-params": "customer_id=5537212111",

"developer-token": "REDACTED"

}

Request: 

{"customerId":"5537212111","query":"\nSELECT\n   
 campaign_budget.id,\ncampaign_budget.name,\n   
 campaign_budget.amount_micros,\n   
 campaign_budget.delivery_method,\ncampaign_budget.status\n 
   FROM campaign_budget"}



**
Response
**
 

Headers: {

"request-id": "dDjjVRVk_x3fvRoZBwN73Q",

"date": "Wed, 13 Mar 2024 16:51:58 GMT",

"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"

}

Fault

---

Status code: 7

Details: The caller does not have permission

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":"dDjjVRVk_x3fvRoZBwN73Q"}
 
 

Request with ID 'dDjjVRVk_x3fvRoZBwN73Q' has failed.

Google Ads failure details:

* authorization_error: 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*



**
Request ID 
**
 

dDjjVRVk_x3fvRoZBwN73Q 










On Wednesday 13 March 2024 at 16:31:12 UTC+1 Google Ads API Forum Advisor 
wrote:

> Hi, 
>
> Thank you for reaching out to the Google Ads API support team.
>
> By reviewing your concern, I understand that you're facing a 
> USER_PERMISSION_DENIED 
> 
>  error. 
> This means the user doesn't have permission to access the customer. 
> According to the documentation 
> ,
>  
> if you're accessing the customer please specify the login-customer-id as 
> the manager account ID without hyphens (-). Client libraries have built in 
> support for this.
>
> Also, kindly upgrade your 'google/gax' to the latest version by running 
> 'composer update'. 
>
> If still the issue persists, provide us with the complete API logs (
> *request* 
> 
>  and  
> 
> *response* 
> 
>  with  
> 
> *request-id* 
> 
>  and  
> *request
>  
> header* 
> )
>  
> generated at your end to assist you further. If you haven't enabled logging 
> yet, would request you to enable logging for the client library that you 
> 

RE: google ads api authrization, permission error

2024-03-13 Thread 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
Hi,

Thank you for reaching out to the Google Ads API support team.

By reviewing your concern, I understand that you're facing a 
USER_PERMISSION_DENIED error. This means the user doesn't have permission to 
access the customer. According to the documentation, if you're accessing the 
customer please specify the login-customer-id as the manager account ID without 
hyphens (-). Client libraries have built in support for this.

Also, kindly upgrade your 'google/gax' to the latest version by running 
'composer update'.

If still the issue persists, provide us with the complete API logs (request and 
response with request-id and request header) generated at your end to assist 
you further. If you haven't enabled logging yet, would request you to enable 
logging for the client library that you are using. You can refer to the guide 
PHP to enable logging at your end.

This message is in relation to case "ref:!00D1U01174p.!5004Q02rzuUy:ref" 
(ADR-00227113)

Thanks,

Google Ads API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/5ALnN0SAALR500NxKHSYzTRhK-hn8GnftLKA%40sfdc.net.