AuthorizationError.USER_PERMISSION_DENIED

405 views
Skip to first unread message

tfgmanag...@gmail.com

unread,
Jun 20, 2016, 9:55:59 AM6/20/16
to AdWords API Forum
Hello I'm begginer and I need help.
I have a MCC account with an email and I have a Test MCC account with a different email, I create a test client too. I have a dev token in my MCC account, then I register my Oauth too with the same email. Now I have a refresh token with test account's email, but when I try to run getCampaigns.java I get this error:

THANKS!!!

[20 Jun 2016 13:46:52,067-requestInfoLogger:INFO:main] Request made: Service: "CampaignServiceInterfacePort" Method: "get" URL: "https://adwords.google.com/api/adwords/cm/v201605/CampaignService" Request ID: "000535b442a306990a0ded85050b3115"
[20 Jun 2016 13:46:52,123-soapXmlLogger:WARN:main] SOAP Request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201605" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>968-655-5552</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>TFG (AwApi-Java, AdWords-Axis/2.16.0, Common-Java/2.16.0, Axis/1.4, Java/1.8.0_91, maven, SelectorBuilder, SelectorField)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <serviceSelector>
                <fields>Id</fields>
                <fields>Name</fields>
                <ordering>
                    <field>Name</field>
                    <sortOrder>ASCENDING</sortOrder>
                </ordering>
                <paging>
                    <startIndex>0</startIndex>
                    <numberResults>100</numberResults>
                </paging>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

[20 Jun 2016 13:46:52,124-soapXmlLogger:WARN:main] SOAP Response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605">
            <requestId>000535b442a306990a0ded85050b3115</requestId>
            <serviceName>CampaignService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>42</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201605">
                    <message>[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AuthorizationError">
                        <fieldPath/>
                        <trigger>&lt;null&gt;</trigger>
                        <errorString>AuthorizationError.USER_PERMISSION_DENIED</errorString>
                        <ApiError.Type>AuthorizationError</ApiError.Type>
                        <reason>USER_PERMISSION_DENIED</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

Exception in thread "main" AxisFault
 faultSubcode: 
 faultString: [AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']
 faultActor: 
 faultNode: 
 faultDetail: 
{https://adwords.google.com/api/adwords/cm/v201605}ApiExceptionFault:<message>[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AuthorizationError"><fieldPath/><trigger>&lt;null&gt;</trigger><errorString>AuthorizationError.USER_PERMISSION_DENIED</errorString><ApiError.Type>AuthorizationError</ApiError.Type><reason>USER_PERMISSION_DENIED</reason></errors>

[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>']
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at com.google.api.ads.adwords.axis.v201605.cm.ApiException.getDeserializer(ApiException.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.google.api.ads.adwords.axis.v201605.cm.CampaignServiceSoapBindingStub.get(CampaignServiceSoapBindingStub.java:1364)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:109)
at com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:248)
at com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:62)
at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:92)
at com.sun.proxy.$Proxy18.get(Unknown Source)
at adwords.axis.v201605.basicoperations.GetCampaigns.runExample(GetCampaigns.java:78)
at adwords.axis.v201605.basicoperations.GetCampaigns.main(GetCampaigns.java:55)

tfgmanag...@gmail.com

unread,
Jun 20, 2016, 9:56:05 AM6/20/16
to AdWords API Forum
Hello, I have an account MCC with this email, and I have a MCC test account with a test client too with a different email. I have my token from my MCC then I go to API center with the same email so I have my client ID and my secret client ID,then I have a refresh token with my test account's email, but now I try to use getCampaings.java and this is my problem:

Can somebody help me? I'm begginer and I need this for my end-of-degree project.
Thanks, and sorry for my english

Shwetha Vastrad (AdWords API Team)

unread,
Jun 20, 2016, 1:08:05 PM6/20/16
to AdWords API Forum
Hi,

The USER_PERMISSION_DENIED error occurs when there is no link between the manager account authenticated in the request and the client account specified in the request header. You would need to use the email address used to create the test manager account to create OAuth credentials to make a call to a test account. You cannot use the email address used to create the production manager account to make API calls to a test account. Could you check if the OAuth 2.0 credentials being used belong to one of the users of the AdWords account specified in the request?

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages