List<String> fields = new ArrayList<>();
fields.add("AdGroupId");
fields.add("CriteriaType");
fields.add("Criteria");
DateRange dateRange = new DateRange();
dateRange.setMin(startDate);
dateRange.setMax(endDate);
Selector selector = new Selector();
selector.getFields().addAll(fields);
selector.setDateRange(dateRange);
ReportDefinition reportDefinition = new ReportDefinition();
reportDefinition.setReportName("Datorama Report");
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.CUSTOM_DATE);
reportDefinition.setReportType(ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT);
reportDefinition.setDownloadFormat(DownloadFormat.GZIPPED_CSV);
reportDefinition.setSelector(selector);
// download the report
ReportDownloader reportDownloader = new ReportDownloader(adWordsSession);
reportDownloader.setReportDownloadTimeout(HTTP_READ_TIMEOUT);
ReportDownloadResponse response = reportDownloader.downloadReport(reportDefinition);
Caused by: HTTP Response Code: 400
at com.google.api.ads.adwords.lib.utils.v201702.DetailedReportDownloadResponseException$Builder.build(DetailedReportDownloadResponseException.java:35)
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.handleResponse(AdHocReportDownloadHelperImpl.java:117)
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.downloadReport(AdHocReportDownloadHelperImpl.java:60)
at sun.reflect.GeneratedMethodAccessor859.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.api.ads.common.lib.utils.AdsUtilityInvocationHandler.handleInvocation(AdsUtilityInvocationHandler.java:46)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:84)
at com.sun.proxy.$Proxy174.downloadReport(Unknown Source)
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelper.downloadReport(AdHocReportDownloadHelper.java:46)
at com.google.api.ads.adwords.lib.utils.v201702.ReportDownloader.downloadReport(ReportDownloader.java:65)\
Hi Andrew,I made this email thread private, so you can respond to it to share the details.CheersAnash
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscribe@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 the Google Groups "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/f0107f6a-a84c-4b99-bcaa-4af52220cfe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Andrew.
Following up on this thread. Were you able to resolve the issue? Please let me know if you need any further assistance.
Thanks,
Sreelakshmi, AdWords API Team=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
2018-03-19 01:21:15 [WARN] c.g.a.a.a.lib.utils.report_download Request made: Service: reportdownload Method: POST clientCustomerId: 125-142-3890 URL: https://adwords.google.com//api/adwords/reportdownload/v201710 Request ID: null ResponseTime(ms): null OperationsCount: null IsFault: true FaultMessage: com.google.api.ads.adwords.lib.utils.ReportException: 400: Bad Request
2018-03-19 01:21:15 [ERROR] c.g.a.a.a.l.c.A.soapXmlLogger Couldn't process XML into a Document
19:07:52 [WARN] c.g.a.a.a.lib.utils.report_download Request made: Service: reportdownload Method: POST clientCustomerId: XXX URL: https://adwords.google.com//api/adwords/reportdownload/v201710 Request ID: null ResponseTime(ms): null OperationsCount: null IsFault: true FaultMessage: com.google.api.ads.adwords.lib.utils.ReportException: 502: Bad Gateway2018-04-15 19:07:52 [INFO] c.g.a.a.a.lib.utils.report_download HTTP request:accept-encoding: [gzip]authorization: REDACTEDuser-agent: [XXX (AwApi-Java, Common-Java/3.12.0, Java/1.8.0_121, maven, ReportDownloader)]developertoken: REDACTEDclientcustomerid: XXXincludezeroimpressions: false
Content:__rdquery: SELECT Conversions,ConversionValue FROM SHOPPING_PERFORMANCE_REPORT WHERE CountryCriteriaId = 2250 DURING 20180316,20180415__fmt: XML
Caused by: HTTP Response Code: 400
at com.google.api.ads.adwords.lib.utils.v201710.DetailedReportDownloadResponseException$Builder.build(DetailedReportDownloadResponseException.java:35)
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/b45c47d5-d7af-41cd-bc11-7f4b693fa770%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.