RE: USER_PERMISSION_DENIED while creating a new campaing with php library

2022-02-22 Thread 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
Hello Bogdan,

Thanks for reaching out to the Google Ads API support. I understand that you’ve 
encountered the error ‘USER_PERMISSION_DENIED’ after migrating process, usually 
this error occurs has the following root causes:

The link between the manager and client account was removed.
Your OAuth credentials are for a user who does not have access to the client 
customer ID specified or any of its manager accounts.

You may double check if your credentials are correct for the said user. With 
that, I would recommend that you regenerate the refreshToken and the OAuth2 
credential using an email address which currently has access to your Google Ads 
account. And for setting the login-customer-id header details you can find here.
However, in the testing phase, the refresh token will expire in 7 days. Please 
refer to this OAuth guide: 
https://developers.google.com/identity/protocols/oauth2#expiration

If the issue persists, could you please provide us with the complete logs 
(request and response with request-id) via the Reply privately to the author 
option.

Best regards,

Jakeia Sabrina
Google Ads API Team
ref:_00D1U1174p._5004Q2WxuQ2: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 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/gU3ad0R7Q9DS00LxGFYQHfRbyIf8TLUyv9NQ%40sfdc.net.


USER_PERMISSION_DENIED while creating a new campaing with php library

2022-02-22 Thread Bogdan Onyshenko
Hello all. I am trying to create a new campaing with google ads api php 
library. Basicly just changed a name of it. I created a developer token 
with manager account, test customer account, Oauth 2 token. While I tryed 
to create a new Campaing I get the following output on a console:

[2022-02-22T15:15:30.020005+03:00] google-ads.WARNING: Request made: Host: 
"googleads.googleapis.com", Method: 
"/google.ads.googleads.v10.services.CampaignBudgetService/MutateCampaignBudgets",
 
CustomerId: 9445807394, RequestId: "AlRf8rUAOGvZnQc5DJyQzQ", IsFault: 1, 
FaultMessage: "["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"]"
[2022-02-22T15:15:30.024408+03:00] google-ads.NOTICE: Request
---
Method Name: 
/google.ads.googleads.v10.services.CampaignBudgetService/MutateCampaignBudgets
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.27 gccl\/14.0.0 gapic\/14.0.0 
gax\/1.11.4 grpc\/1.43.0 rest\/1.11.4",
"x-goog-request-params": "customer_id=9445807394",
"developer-token": "REDACTED",
"login-customer-id": "7082366600"
}
Request:
{"customerId":"9445807394","operations":[{"create":{"name":"Test Budget 
#2022-02-22T15:15:29.387+03:00","amountMicros":"50","deliveryMethod":"STANDARD"}}]}

Response
---
Headers: {
"request-id": "AlRf8rUAOGvZnQc5DJyQzQ",
"date": "Tue, 22 Feb 2022 12:15:28 GMT",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":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\""
}

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":"AlRf8rUAOGvZnQc5DJyQzQ"}
Request with ID 'AlRf8rUAOGvZnQc5DJyQzQ' 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

I tryed to remove login customer id but getting the operation is not 
permited for a current context. How Can I solve the problem?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/2703f369-b588-476b-9e92-ecb28a2f2e6cn%40googlegroups.com.