Google Ads - PERMISSION DANIED

44 views
Skip to first unread message

Emanuele Lucchese

unread,
Jun 13, 2023, 11:56:07 AM6/13/23
to Google Ads API and AdWords API Forum

Hello,

I am experiencing an issue while running an application that utilizes the Google Ads API to create a campaign budget. I am receiving the error message "The caller does not have permission." I would like to request your assistance in resolving this issue.


Code:
$budget = new CampaignBudget([ 'name' => 'Interplanetary Cruise Budget #'.date('c'), 'delivery_method' => BudgetDeliveryMethod::STANDARD, 'amount_micros' => 500000 ]); // Creates a campaign budget operation. $campaignBudgetOperation = new CampaignBudgetOperation(); $campaignBudgetOperation->setCreate($budget); // Issues a mutate request. $campaignBudgetServiceClient = $googleAdsClient->getCampaignBudgetServiceClient(); $response = $campaignBudgetServiceClient->mutateCampaignBudgets($customerId, [$campaignBudgetOperation]); /** @var CampaignBudget $addedBudget */ $addedBudget = $response->getResults()[0]; printf("Added budget named '%s'%s", $addedBudget->getResourceName(), PHP_EOL);

I have verified that the Google Ads account has the appropriate permissions to access the API and create campaign budgets. I have also checked the authentication credentials and correctly set the customerId as a string.

However, despite these checks, I continue to receive the "The caller does not have permission" error. I would like to request your support in identifying the cause of the problem and finding a solution.

Thank you in advance for any assistance you can provide.

Best regards, [Your Name]

Google Ads API Forum Advisor

unread,
Jun 16, 2023, 5:03:34 AM6/16/23
to lucchese.e...@gmail.com, adwor...@googlegroups.com

Hi Emanuele,

Thank you for reaching out to us.

Kindly note that "USER_PERMISSION_DENIED" <> error means that a user doesn't have permission to access a customer and you’re accessing a client customer using 'login-customer-id’ in the request.

To address the above error, you will need to ensure that the user / email address you used to generate the credentials indeed has access <https://developers.google.com/google-ads/api/reference/rpc/v14/AuthorizationErrorEnum.AuthorizationError?hl=en#user_permission_denied> to the account in your request. If the user / email address has access or is associated with the MCC / manager account, you will need to specify the said MCC / manager account ID as the value of the login-customer-id <https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid> field.

If the issue still persists, you may provide us with the user account / email address that you used to generate API access or refresh tokens and the complete API logs (request and response with request-id) generated on your end, so that we could further check this and provide precise guidance accordingly.

Note that logs can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. You may check here and click your client library for the specific guideline to enable it.

For REST interface requests, you can enable logging via the curl command by using the -i flag. This will cause the tool to include the HTTP response headers in the output.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2mCXAJ:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages