KEYWORDS_PERFORMANCE_REPORT returns AuthenticationError.NOT_ADS_USER with trigger null

49 views
Skip to first unread message

Guilherme Nassim

unread,
Jun 1, 2015, 5:27:17 PM6/1/15
to adwor...@googlegroups.com
Hi,

I am developing an application to daily download a Keyword Performance report using the Adwords API. To get the OAuth 2.0 I pass the followed values:

{
         iss = "xxxxxxxx@developer.gserviceaccount.com",
         iat = times[0],
         exp = times[1],
}

And I receive an access_token back that I use to make an Http request with this headers:

         request.Headers.Add("Authorization", "Bearer " + access_token);
         request.Headers.Add("developerToken", "xxxxxxxxxxxx");
         request.Headers.Add("clientCustomerId", "xxx-xxx-xxxx");
         request.Method = "POST";
         request.ContentType = "application/x-www-form-urlencoded";

With this body:

__rdxml=<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201502"><selector><fields>AccountDescriptiveName</fields>
    <fields>AccountCurrencyCode</fields>
    <fields>Impressions</fields>
    <fields>Clicks</fields>
    <fields>Cost</fields>
    <fields>AveragePosition</fields>
    <predicates>
      <field>Impressions</field>
      <operator>GREATER_THAN</operator>
      <values>0</values>
    </predicates>
  </selector>
  <reportName>Custom Keyword Performance Report</reportName>
  <reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>
  <dateRangeType>YESTERDAY</dateRangeType>
  <downloadFormat>CSV</downloadFormat>
</reportDefinition>

the response that I get back is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportDownloadError>
  <ApiError>
    <type>AuthenticationError.NOT_ADS_USER</type>
    <trigger>&lt;null&gt;</trigger>
    <fieldPath></fieldPath>
  </ApiError>
</reportDownloadError>

Using OAuth 2.0 Playground application ( https://developers.google.com/oauthplayground/ ) passing the post body with developerToken and clientCustomerId it works.
What should I do?

Thanks,

Guilherme Foz Nassim

Thanet Knack Praneenararat (AdWords API Team)

unread,
Jun 2, 2015, 3:58:28 AM6/2/15
to adwor...@googlegroups.com, guilher...@gmail.com
Hi Guilherme,

The NOT_ADS_USER error means that the user whose OAuth credentials you are using is not associated with an AdWords account. 
Please generate another refresh/access token, making sure you are signed in as a user with access to your test account.

Also, please take a look at the SOAP Primer guide since it explains which HTTP header you will need to use when you pass the access token.

Cheers,
Thanet, AdWords API Team

Guilherme Nassim

unread,
Jun 2, 2015, 6:37:01 AM6/2/15
to adwor...@googlegroups.com, guilher...@gmail.com
Hi Thanet,

Thanks for your answer but I am using OAuth 2.0 for Server to Server Applications therefore the user that request is a server account email address. The owner of this application, the one that generated the OAuth client Id and the key, is the same owner of the Adwords account. How can I associate this server account email address to my Adwords account?

Regards,
Guilherme Nassim

Thanet Knack Praneenararat (AdWords API Team)

unread,
Jun 3, 2015, 8:06:39 AM6/3/15
to adwor...@googlegroups.com, guilher...@gmail.com
Hello,

I think what you would like to do is impersonation as your AdWords account user.

This guide may be useful to what you are trying to achieve. 
Search for impersonate in the page and try following the steps.

Hope this help and please let me know if that doesn't work.

Cheers,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages