Hi, I am using the following example code provided in python client library
to download a report. It is giving me the following error.
AdWordsError: HTTP Error 400: Bad Request
[ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH @ selector]
I am a beginner in this.Can anyone help on this please.
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..', '..'))
# Import appropriate classes from the client library.
from adspygoogle import AdWordsClient
# Specify where to download the file here.
path = 'c:/python26/tmp/report_download.csv'
def main(client, path):
# Initialize appropriate service.
report_downloader = client.GetReportDownloader(
'https://adwords.google.com', 'v201109')
# Create report definition.
report = {
'reportName': 'Last 7 days CAMPAIGN_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_7_DAYS',
'reportType': 'CAMPAIGN_PERFORMANCE_REPORT',
'downloadFormat': 'CSV',
'selector': {
'fields': ['CampaignID','Clicks', 'Impressions','Cost']
},
# Enable to get rows with zero impressions.
'includeZeroImpressions': 'false'
}
file_path = report_downloader.DownloadReport(report, file_path=path)
print 'Report was downloaded to \'%s\'.' % file_path
if __name__ == '__main__':
# Initialize client object.
client = AdWordsClient(path=os.path.join('..', '..', '..', '..', '..'))
main(client, path)
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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