AuthorizationError.USER_PERMISSION_DENIED Error

39 views
Skip to first unread message

Pavunkumar

unread,
Dec 27, 2018, 9:11:10 AM12/27/18
to AdWords API and Google Ads API Forum
php   examples/AdWords/v201806/BasicOperations/GetCampaigns.php

Request Log

[2018-12-22 16:13:25] AW_SOAP.WARNING: clientCustomerId=951-020-1282 operations=1 service=CampaignService method=get responseTime=114 requestId=00057d9a08911a200a62e0d62507eadc server=adwords.google.com isFault=1 faultMessage=[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>']  
[2018-12-22 16:13:25] AW_SOAP.NOTICE: POST /api/adwords/cm/v201806/CampaignService?wsdl HTTP/1.1
Connection: close
User-Agent: PHP-SOAP/5.6.29
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 916
Authorization: REDACTED

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201806"><SOAP-ENV:Header><ns1:RequestHeader><ns1:clientCustomerId>951-020-1282</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>unknown (AwApi-PHP, googleads-php-lib/38.0.0, PHP/5.6.29)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns1:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:get><ns1:serviceSelector><ns1:fields>Id</ns1:fields><ns1:fields>Name</ns1:fields><ns1:ordering><ns1:field>Name</ns1:field><ns1:sortOrder>ASCENDING</ns1:sortOrder></ns1:ordering><ns1:paging><ns1:startIndex>0</ns1:startIndex><ns1:numberResults>500</ns1:numberResults></ns1:paging></ns1:serviceSelector></ns1:get></SOAP-ENV:Body></SOAP-ENV:Envelope>

Dont know, clientCustomerId=951-020-1282   Why this is coming. No where i specified  client cumstomer id value,  Is this cause of the problem am facing 

All Looks fine. Could not find , why am getting this error. Please advice 

Thanks 

Milind Sankeshware (AdWords API Team)

unread,
Dec 27, 2018, 3:51:01 PM12/27/18
to AdWords API and Google Ads API Forum
Hi,

The USER_PERMISSION_DENIED error occurs when there is no link between the user authenticating the API request and the client account specified in the headers. Please make sure that the user authenticating the call having access to the account targeted in the API call. If the user has access to the manager account 951-020-1282, he will be able to make API calls to the linked account as well.

Also, please note that the GetCampaigns.php should only be performed against a client account. You are calling against the manager account 951-020-1282, so the result is empty.

Thanks,
Milind, AdWords API Team
Reply all
Reply to author
Forward
0 new messages