Hi there guys,
The dateRange object is part of the Selector.
This code worked for me:

  dateStart='20140725'
  dateEnd='20140727'
  # Create report definition.
  report = {
      'reportName': 'acc_perf',
      #'dateRangeType': 'LAST_7_DAYS',
      'dateRangeType': 'CUSTOM_DATE',
      'reportType': 'ACCOUNT_PERFORMANCE_REPORT',
      'downloadFormat': 'CSV',
      'selector': {
          'fields': ['ExternalCustomerId', 'Cost'],
          'dateRange': {'min': dateStart, 'max': dateEnd},
      },
      # Enable to get rows with zero impressions.
      'includeZeroImpressions': 'false'
  }

Good luck!

On Wednesday, February 27, 2013 3:34:03 PM UTC-3, Bryan Balin wrote:
>
> Hi -- I've seen this problem resoved for PHP, but the Python adspygoogle 
> package isn't one-for-one, so I'm asking this question.  I'm trying to get 
> custom dates for an account performance report.   The below code creates 
> the following error: "adspygoogle.common.Errors.ValidationError: Field 
> 'startDate' is not in type 'reportDefinition'".  Any ideas on how I should 
> structure my request so that adspygoogle can read it properly?
>
>
>
> client = AdWordsClient(path=os.path.join('..', '..', '..', '..', '..'))
>
>
> # Specify where to download the file here.
>
> path = 'perf_report_download.csv'
>
>
> report_downloader = client.GetReportDownloader('https://adwords.google.com', 
> 'v201209')
>
>
>  # Create report definition.
>
> report = {
>
> 'reportName': 'Last 7 days ACCOUNT_PERFORMANCE_REPORT',
>
> 'dateRangeType': 'CUSTOM_DATE', 
>
> 'startDate': '20100922', 
>
> 'endDate': '20130205',
>
> 'reportType': 'ACCOUNT_PERFORMANCE_REPORT',
>
> 'downloadFormat': 'CSV',
>
> 'selector': {
>
> 'fields': ['AdNetworkType1', 'Date','HourOfDay','Impressions', 'Cost', 
> 'Clicks', 'AverageCpc', 'AverageCpm']
>
> },
>
> # Enable to get rows with zero impressions.
>
> 'includeZeroImpressions': 'true'
>
> }
>
>
> file_path=report_downloader.DownloadReport(report, file_path=path)
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to