ADGROUP_PERFORMANCE_REPORT returns 400 error

42 views
Skip to first unread message

sai...@digitaltigers.de

unread,
Nov 7, 2018, 10:56:21 AM11/7/18
to AdWords API and Google Ads API Forum
Hi everyone!

I faced with another one issue, and cannot understand what can be a problem...

ReportQuery query = new ReportQuery.Builder()
.fields(
"Id")
.from(ReportDefinitionReportType.ADGROUP_PERFORMANCE_REPORT)
.where("Status").equalTo(ENABLED_STATUS)
.build();

ReportingConfiguration reportingConfiguration =
new ReportingConfiguration.Builder()
.skipColumnHeader(true)
.skipReportHeader(true)
.skipReportSummary(false)
.includeZeroImpressions(true)
.build();
session.setReportingConfiguration(reportingConfiguration);
ReportDownloaderInterface reportDownloader =
adWordsServices.getUtility(session, ReportDownloaderInterface.class);
BufferedReader reader = null;
AdGroupStoreIterator adGroupStoreIterator = new AdGroupStoreIterator(new ArrayList<>());
try {
// Set the property api.adwords.reportDownloadTimeout or call
// ReportDownloader.setReportDownloadTimeout to set a timeout (in milliseconds)
// for CONNECT and READ in report downloads.
final ReportDownloadResponse response =
reportDownloader.downloadReport(query.toString(), DownloadFormat.CSV);
// Read the response as a BufferedReader.
reader = new BufferedReader(new InputStreamReader(response.getInputStream(), UTF_8));


on the line "ReportDownloaderInterface reportDownloader = adWordsServices.getUtility(session, ReportDownloaderInterface.class);" the programm go to the catch block an shows me these output:

[07 Nov. 2018 16:38:46,500-report_download:INFO:main] HTTP request:
accept-encoding: [gzip]
authorization: REDACTED
user-agent: [unknown (AwApi-Java, AdWords-Axis/4.1.0, Common-Java/4.1.0, Axis/1.4, Java/10.0.2, jars, ReportDownloader, ReportQueryBuilder)]
developertoken: REDACTED
clientcustomerid: 8****-4495
skipreportheader: false
skipcolumnheader: false
skipreportsummary: false
includezeroimpressions: true


Could you please explain what I am doing wrong?

Thanks!!
Saidar

Dannison Yao (AdWords API Team)

unread,
Nov 7, 2018, 7:10:42 PM11/7/18
to AdWords API and Google Ads API Forum
Hi Saidar,

Unfortunately, I cannot provide a comment on why it is redirecting to your catch function. However, you could refer to the sample codes for reporting provided in this guide and our reporting guidelines on how to download your report.

If you encounter any API related issues after following the guide, feel free to write us back and we will be happy to assist you.

Regards,
Dannison
AdWords API Team

Vincent Racaza (AdWords API Team)

unread,
Nov 8, 2018, 4:52:25 AM11/8/18
to AdWords API and Google Ads API Forum
Hi Saidar,

I am a colleague of Dannison and I would like to make a correction on our previous answer. I have tried replicating your issue on my end and found out that the error is caused by the select clause field name "Id" and the where clause field name "Status". Kindly replace "Id" with "AdGroupId" and "Status" with "AdGroupStatus" instead. You may also refer here for the complete list of attributes/fields the Adgroup Performance report allows. Also, I would like to point out that your constant variable ENABLED_STATUS should be equal to "ENABLED" String value. Let me know if error persists after trying the solution mentioned.

Best regards,
Vincent
AdWords API Team

On Wednesday, November 7, 2018 at 11:56:21 PM UTC+8, sai...@digitaltigers.de wrote:

sai...@digitaltigers.de

unread,
Nov 8, 2018, 4:59:55 AM11/8/18
to AdWords API and Google Ads API Forum
Hi, Vincent!

Omg, I forgot to check it... 
Thanks you very much it works now!! 

Best Regards,
Saidar.

четверг, 8 ноября 2018 г., 10:52:25 UTC+1 пользователь Vincent Racaza (AdWords API Team) написал:
Reply all
Reply to author
Forward
0 new messages