I am trying to query the adwords api (v201603) and am using/extending the Java examples provided.
The problem I am encountering is being able to specify a specific date to download the report data for the CLICK_PERFORMANCE_REPORT report. This report is restricted to returning a single days worth of data at a time (for up to the last 90 days).
I can get todays and yesterdays data using the specifiers : ReportDefinitionDateRangeType.TODAY and ReportDefinitionDateRangeType.YESTERDAY, but what I really need to do is be able to specify a specific date within the last 90 days in order to get as much historical data as possible.
I have tried the following:
DateRange dr = new DateRange();
dr.setMin("20160401");
dr.setMax("20160402");
selector.setDateRange(dr);
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.CUSTOM_DATE);
reportDefinition.setReportType(ReportDefinitionReportType.CLICK_PERFORMANCE_REPORT);
reportDefinition.setDownloadFormat(DownloadFormat.CSV);
Both with and without the custom date specifier - and either gives the following error:
Report was not downloaded due to: HTTP Response Code: 400, Trigger: A single day DateRange is required for reportType: CLICK_PERFORMANCE_REPORT, Type: ReportDefinitionError.INVALID_DATE_RANGE_FOR_REPORT
Any help much appreciated, thanks in advance