[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'']

62 views
Skip to first unread message

Muteeb Ahmed Kamboh

unread,
May 13, 2019, 5:40:43 PM5/13/19
to AdWords API and Google Ads API Forum

I am Facing this Error Can Any One Help Me Why This error Occur On API response how i can Grant The Access to Send the Invitation to customer account through API?

[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'']

$managerCustomerID = 3435423432;

$oAuth2Credential = (new OAuth2TokenBuilder())
->withClientId(CLIENT_ID)
->withClientSecret(CLIENT_SECRET)
->withRefreshToken($UserRefreshToken)
->build();

$soapSettings = (new SoapSettingsBuilder())
->disableSslVerify()
->build();

$session = (new AdWordsSessionBuilder())
->withDeveloperToken(DEVELOPERTOKEN)
->withOAuth2Credential($oAuth2Credential)
->withSoapSettings($soapSettings)
->withClientCustomerId($CustomerID)
->build();

$adWordsServices = new AdWordsServices();
$ManagedCustomerService = $adWordsServices->get($session, ManagedCustomerService::class);

$operations = [];

$ManagedCustomerLink = new ManagedCustomerLink();
$ManagedCustomerLink->setClientCustomerId($CustomerID);
$ManagedCustomerLink->setLinkStatus('PENDING');
$ManagedCustomerLink->setManagerCustomerId($managerCustomerID);

$operation = new LinkOperation();
$operation->setOperand($ManagedCustomerLink);
$operation->setOperator('ADD');
$operations = [$operation];

try {

$result = $ManagedCustomerService->mutateLink($operations);
echo "Invite sent"; echo "<pre>"; print_r($result);

} catch (Exception $e) {
echo $e->getMessage();
}

googleadsapi...@google.com

unread,
May 14, 2019, 3:28:04 AM5/14/19
to adwor...@googlegroups.com
Hi Muteeb,

The USER_PERMISSION_DENIED error in the AdWords API indicates that you might be using OAuth2 credentials that does not have access to the (clientCustomerId) account you are authenticating with. To avoid this error, you will need to use the OAuth2 credentials that were generated using an email address which has access to the account indicated in your request header.

I hope this helps and feel free to write back if the issue persists. Should you still encounter the error, you may send to me the email address you used to generate the OAuth2 credentials and also the complete SOAP request and response logs so I can further investigate. You may then send your reply using the Reply privately to author option.

Thanks and regards,
Peter
Google Ads API Team

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/dd30e4c5-4fee-4321-8be8-b1d229468782%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muteeb Ahmed Kamboh

unread,
May 14, 2019, 5:33:14 PM5/14/19
to AdWords API and Google Ads API Forum
I have the Basic access in my MCC account. Can Basic Access MutateLink and send invitation to customer through API?

googleadsapi...@google.com

unread,
May 15, 2019, 1:10:57 AM5/15/19
to adwor...@googlegroups.com
Hi Muteeb,

Basic access can allow you to use the API and make calls to production accounts. However, in order to access (get, create, modify) data of those accounts, you will need the OAuth2 credentials.

Best regards,
Peter
Google Ads API Team

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

On 05/14/19 15:30:23 muteebahm...@gmail.com wrote:
I have the Basic access in my MCC account. Can Basic Access MutateLink and send invitation to customer through API?

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
Reply all
Reply to author
Forward
0 new messages