NOT_ADS_USER error with OfflineConversionFeedService

441 views
Skip to first unread message

Michel Tricot

unread,
Jan 7, 2014, 10:01:07 PM1/7/14
to adwor...@googlegroups.com
Hi,

We recently worked on integrating the OfflineConversionFeedService API in our system.

We have the authentication mechanism working and we have been able to upload a conversion sample to a real account that we used for test.

Two weeks ago we tried to upload real conversions on behalf of our customer. This customer gave us permissions to upload conversions on their account thru the OAuth authentication.

Here is a test code that we use to verify that the configuration should work:

  String clientId = "[truncated]";
  String clientSecret = "[truncated]";
  String developerToken = "[truncated]";

  Credential oauthCredentials = new OfflineCredentials.Builder()
      .forApi(OfflineCredentials.Api.ADWORDS)
      .withClientSecrets(clientId, clientSecret)
      .withRefreshToken("[truncated]") // our customer refresh token
      .build().generateCredential();

  AdWordsSession session = new AdWordsSession.Builder()
      .withOAuth2Credential(oauthCredentials)
      .withDeveloperToken(developerToken)
      .withClientCustomerId("[truncated]") // our customer client customer id
      .withUserAgent("[truncated]")
      .build();

  AdWordsServices adWordsServices = new AdWordsServices();

  String gclid = "[truncated]"; // google click id that we got from the click

  String conversionName = "[truncated]"; // our customer conversion name
  String conversionTime = getTimestampForApi(System.currentTimeMillis());
  Double conversionValue = 2.0;

  OfflineConversionFeedServiceInterface offlineConversionFeedService = adWordsServices.get(session, OfflineConversionFeedServiceInterface.class);

  OfflineConversionFeed feed = new OfflineConversionFeed();
  feed.setGoogleClickId(gclid);
  feed.setConversionName(conversionName);
  feed.setConversionTime(conversionTime);
  feed.setConversionValue(conversionValue);

  OfflineConversionFeedOperation offlineConversionOperation = new OfflineConversionFeedOperation();
  offlineConversionOperation.setOperator(Operator.ADD);
  offlineConversionOperation.setOperand(feed);

  OfflineConversionFeedReturnValue offlineConversionReturnValue = offlineConversionFeedService
      .mutate(new OfflineConversionFeedOperation[]{offlineConversionOperation});


We validated with one of Google's employee that this code is working when we ran tests on the account he gave us.

For our production customer we keep getting the following error:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201309" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>[truncated]</ns1:clientCustomerId>
            <ns1:developerToken>[truncated]</ns1:developerToken>
            <ns1:userAgent>[truncated] (AwApi-Java, AdWords-Axis/1.20.0, Common-Java/1.20.0, Axis/1.4, Java/1.6.0_65, maven)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201309">
            <operations>
                <operator>ADD</operator>
                <operand>
                    <googleClickId>[truncated]</googleClickId>
                    <conversionName>[truncated]</conversionName>
                    <conversionTime>20140107 184907</conversionTime>
                    <conversionValue>2.0</conversionValue>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

14/01/07 18:49:09 WARN AdWordsServiceClient.soapXmlLogger: SOAP Response:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309">
            <requestId>[truncated]</requestId>
            <serviceName>OfflineConversionFeedService</serviceName>
            <methodName>mutate</methodName>
            <operations>0</operations>
            <responseTime>57</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[AuthenticationError.NOT_ADS_USER @ ; trigger:'&lt;null&gt;']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201309">
                    <message>[AuthenticationError.NOT_ADS_USER @ ; trigger:'&lt;null&gt;']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AuthenticationError">
                        <fieldPath/>
                        <trigger>&lt;null&gt;</trigger>
                        <errorString>AuthenticationError.NOT_ADS_USER</errorString>
                        <ApiError.Type>AuthenticationError</ApiError.Type>
                        <reason>NOT_ADS_USER</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

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

[AuthenticationError.NOT_ADS_USER @ ; trigger:'<null>']
   
We are getting AuthenticationError.NOT_ADS_USER errors. Does anyone of you have an idea on what might go wrong?

Let me know if you need more information, thanks for your answer.

Ray Tsang (AdWords API Team)

unread,
Jan 13, 2014, 3:51:07 PM1/13/14
to adwor...@googlegroups.com
Michel,

It looks like you are using the AdWords API Java client library.  In your ads.properties, you should have configured the client ID, client secret, and I assume you also have a refresh token configured.

The AuthenticationError.NOT_ADS_USER indicates that the logged user doesn't have access to any AdWords account.

The refresh token must belong to a user that has access the the AdWords account.  I'm suspecting that the refresh token may be for a different user.  When granting the authorization - please make sure the right user was logged in.

Thanks,

--
Ray Tsang (AdWords API Advisor)

Julian Bouma

unread,
Jan 22, 2014, 11:25:22 AM1/22/14
to adwor...@googlegroups.com
Parameters:

    String clientId = "947836558679-0ghhskmsvo10s23akfdioap794grc5ub.apps.googleusercontent.com";
    String clientSecret = "[truncated]";
    String developperToken = "[truncated]";

    String refreshToken = "[truncated]";
    String clientCustomerId = "348-017-6023";

    String gclid = "CPDZ6fiv_rsCFeJF7AodgVEAqw";
    String conversionName = "Offline Conversions 9/27";

and here is the exception:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201309" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>348-017-6023</ns1:clientCustomerId>

            <ns1:developerToken>[truncated]</ns1:developerToken>
            <ns1:userAgent>Liveramp Attribution Uploader test (AwApi-Java, AdWords-Axis/1.20.0, Common-Java/1.20.0, Axis/1.4, Java/1.6.0_65, maven)</ns1:userAgent>

            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201309">
            <operations>
                <operator>ADD</operator>
                <operand>
                    <googleClickId>CPDZ6fiv_rsCFeJF7AodgVEAqw</googleClickId>
                    <conversionName>Offline Conversions 9/27</conversionName>
                    <conversionTime>20140120 143927</conversionTime>

                    <conversionValue>2.0</conversionValue>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

14/01/20 14:39:30 WARN AdWordsServiceClient.soapXmlLogger: SOAP Response:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309">
            <requestId>0004f06e90a634b80a42e50900002cdc</requestId>

            <serviceName>OfflineConversionFeedService</serviceName>
            <methodName>mutate</methodName>
            <operations>0</operations>
            <responseTime>45</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/v201309">
                    <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
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
 faultSubcode: 
 faultString: [AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']
 faultActor: 
 faultNode: 
 faultDetail: 
    {https://adwords.google.com/api/adwords/cm/v201309}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>

Julian Bouma

unread,
Jan 23, 2014, 11:38:33 AM1/23/14
to adwor...@googlegroups.com, Michel Tricot
To add some more details here, we received the required tokens from the client through our auth process, but we are still getting a USER_PERMISSION_DENIED. We thought the authentication process would take care of that, but perhaps we are missing something here. 


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/g4zIyidbObk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

radley...@kellybrady.com

unread,
Apr 29, 2016, 9:05:52 AM4/29/16
to AdWords API Forum
How do you determine who is the right person. I am also getting this error and I cannot solve the issue. I have used my refresh token in the sample C# application and was able to pass authentication. Is it because this request needs an access token and not a refresh token?? Can we use refresh tokens instead of access tokens here??

Anthony Madrigal

unread,
Jul 18, 2016, 4:27:29 PM7/18/16
to AdWords API Forum
Hi Radley,

If you are still experiencing this issue, can you please create a new thread so that we can help you out?

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