I have issue downloading the Ad_performance report using HTTP calls

52 views
Skip to first unread message

TECGCA96 TECGCA96

unread,
Apr 20, 2020, 12:42:15 PM4/20/20
to AdWords API and Google Ads API Forum
I have successfully got the access token. I was trying to pass the request mentioned below to get the values against these fields:
<?xml version="1.0"?>
  <soapenv:Header>
    <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
      <ns1:clientCustomerId>xxxxxxxx</ns1:clientCustomerId>
      <ns1:developerToken >xxxxxxx</ns1:developerToken>
      <ns1:userAgent>xxxxxxxx</ns1:userAgent>
      <ns1:validateOnly>false</ns1:validateOnly>
      <ns1:partialFailure>false</ns1:partialFailure>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
    <reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201809">
<selector>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
<fields>Impressions</fields>
<fields>Clicks</fields>
<fields>Cost</fields>
<predicates>
  <field>AdGroupStatus</field>
  <operator>IN</operator>
  <values>ENABLED</values>
  <values>PAUSED</values>
</predicates>
</selector>
<reportName>Performance Report</reportName>
<reportType>AD_PERFORMANCE_REPORT</reportType>
<dateRangeType>LAST_7_DAYS</dateRangeType>
<downloadFormat>CSV</downloadFormat>
</reportDefinition>
  </soapenv:Body>
</soapenv:Envelope>

XML request:
__rdxml: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
<selector>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
<fields>Impressions</fields>
<fields>Clicks</fields>
<fields>Cost</fields>
<predicates>
  <field>AdGroupStatus</field>
  <operator>IN</operator>
  <values>ENABLED</values>
  <values>PAUSED</values>
</predicates>
</selector>
<reportName>Performance Report</reportName>
<reportType>AD_PERFORMANCE_REPORT</reportType>
<dateRangeType>LAST_7_DAYS</dateRangeType>
<downloadFormat>CSV</downloadFormat>
</reportDefinition>

I have also tried the xml structure provide the document , still same error i cant see.

Error: soap request
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.MISSING_PARAMETER</type><trigger>Missing report definition</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>

Error for xml request:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.MISSING_PARAMETER</type><trigger>Missing report definition</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>

Google Ads API Forum Advisor Prod

unread,
Apr 20, 2020, 6:29:19 PM4/20/20
to tecg...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out! Upon taking a look at the error, it appears that your request is incomplete. Did you ensure that you were closely following the instructions mentioned in this guide for making a basic call using cURL? Additionally, did you correctly configure your authentication token and account login into your XML? 

If you continue to run into issues, I strongly recommend that you download and utilize one of our client libraries, as they eliminate the manual construction of requests. You may also use our Reporting sample codes once you have a client library configured.

Thanks,
Danica Calusin, Google Ads API Team 
 

ref:_00D1U1174p._5001UZZ3XI:ref
Message has been deleted

TECGCA96 TECGCA96

unread,
Apr 21, 2020, 9:46:37 AM4/21/20
to AdWords API and Google Ads API Forum
Hi Thanks for the quick response,

Hi Thanks for the quick response.
 
1. Access_token i have been getting the right way itself, which is recommended by the AdwordsApi document   https://developers.google.com/adwords/api/docs/guides/authentication . I am using the test developer token, is that an issue ?
2. Regarding the request which i am sending as soap , i created myself, because i didn't find any relevant exmaple in the document for Report one. The XML structured input i replicated all the fields from the document https://developers.google.com/adwords/api/docs/guides/reporting
3. Regarding java client example , i have used that as well but i get error out there as well:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Module
at com.google.api.ads.adwords.lib.utils.AdWordsInternals.<clinit>(AdWordsInternals.java:37)
at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.getInternals(OfflineCredentials.java:107)
at com.google.api.ads.common.lib.auth.OfflineCredentials$Builder.defaultOptionals(OfflineCredentials.java:318)
at com.google.api.ads.common.lib.auth.OfflineCredentials$Builder.forApi(OfflineCredentials.java:312)
at com.googleAnalatics.google.AdWordsApi.main(AdWordsApi.java:40)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Module
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)   

TECGCA96 TECGCA96

unread,
Apr 21, 2020, 11:12:55 AM4/21/20
to AdWords API and Google Ads API Forum
Error msg i get now is this one below:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Preconditions
at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.<init>(OfflineCredentials.java:89)
at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.<clinit>(OfflineCredentials.java:81)
at AdWordsApi.main(AdWordsApi.java:37)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Preconditions
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more

TECGCA96 TECGCA96

unread,
Apr 21, 2020, 1:45:27 PM4/21/20
to AdWords API and Google Ads API Forum
Can anyone help on my issue mentioned above, i have to complete this as soon as possible. 
Fine with anyone of the issues, either HTTP call or using AdWord API libraries.  

Google Ads API Forum Advisor Prod

unread,
Apr 21, 2020, 3:52:20 PM4/21/20
to tecg...@gmail.com, adwor...@googlegroups.com
Hello,

Using a test developer token should not be an issue if you are making calls against a test account. With regards to the error you are receiving, the issue appears to be related to the Java client library. I suggest you reach out to the client library owners as they will be better equipped to assist you on this matter. You can open your concern on the GitHub Issue tracker here.

TECGCA96 TECGCA96

unread,
Apr 21, 2020, 7:35:49 PM4/21/20
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Thank you, I will do that. 

How about my error when i make an HTTP request call ? Any resolution on that please ?

Google Ads API Forum Advisor Prod

unread,
Apr 22, 2020, 9:03:15 PM4/22/20
to tecg...@gmail.com, adwor...@googlegroups.com
Greetings!

If you really want to try all of this with curl, you can do this. Please replace the <INSERT...> with your own information. The first command gets you the access token, which you insert into the second command. The second gets you the report you needed.  

curl --data "refresh_token=<INSERT_REFRESH_TOKEN>&client_id=<INSERT_CLIENT_ID>&client_secret=<INSERT_CLIENT_SECRET>&grant_type=refresh_token" -X POST "https://www.googleapis.com/oauth2/v3/token"

curl --header "Authorization: Bearer <INSERT_ACCESS_TOKEN>" --header "developerToken: <INSERT_DEVELOPER_TOKEN>" --header "clientCustomerId: <INSERT_CLIENT_CUSTOMER_ID_WITH_DASHES>" --header "clientSecret: <INSERT_CLIENT_SECRET>" https://adwords.google.com/api/adwords/reportdownload/v201809 --data "__rdquery=SELECT CampaignId, AdGroupId, Impressions, Clicks, Cost FROM AD_PERFORMANCE_REPORT WHERE AdGroupStatus IN [ENABLED, PAUSED] DURING LAST_7_DAYS&__fmt=CSV"

Even though it's possible to do this on the command line, I do agree with Danica that if you can get that client library working, it's a lot more friendly.

Cheers,
Nadine Wang, Google Ads API Team

ref:_00D1U1174p._5001UZZ3XI:ref

TECGCA96 TECGCA96

unread,
Apr 23, 2020, 7:00:28 AM4/23/20
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Thank you for your help! 
I will try this and get back to you. Regarding the client library, i have raised the concern already, but i did not get the reply from them. If i get one i will check that too
Reply all
Reply to author
Forward
0 new messages