suds.TypeNotFound: Type not found: 'dateRange'

125 views
Skip to first unread message

Chaitanya Phani

unread,
Jan 10, 2018, 3:23:14 AM1/10/18
to AdWords API Forum
Hi,

I want to pull the data from Adwords API for some date range. Getting the following error. 

Error Message:

 
 File "C:\Python27\lib\site-packages\suds\mx\core.py", line 72, in append
   
self.appender.append(parent, content)
 
File "C:\Python27\lib\site-packages\suds\mx\appender.py", line 88, in append
    appender
.append(parent, content)
 
File "C:\Python27\lib\site-packages\googleads\util.py", line 93, in PatchedAppend
    suds
.mx.appender.Appender.append(self, child, cont)
 
File "C:\Python27\lib\site-packages\suds\mx\appender.py", line 168, in append
   
self.marshaller.append(parent, content)
 
File "C:\Python27\lib\site-packages\suds\mx\core.py", line 71, in append
   
if self.start(content):
 
File "C:\Python27\lib\site-packages\suds\mx\literal.py", line 86, in start
   
raise TypeNotFound(content.tag)
suds
.TypeNotFound: Type not found: 'dateRange'


Here is the complete code:

def download_Performance_Criteria_Report(client):
    rep_downloader
= client.GetReportDownloader(version='v201710')
    report
= {
           
'reportName' : 'CAMPAIGN_PERFORMANCE_REPORT',
           
'dateRangeType' :'CUSTOM_DATE',
           
'reportType': 'CAMPAIGN_PERFORMANCE_REPORT',
           
'downloadFormat': 'CSV',
           
'selector': {
               
'fields': ['CampaignId','CampaignName','ExternalCustomerId','Impressions','Clicks','Cost','Date']
               
},
               
'dateRange': { 'min' : '20180101',
                               
'max' : '20180105'
                             
}
           
}
    rep_downloader
.DownloadReport(report,sys.stdout,skip_report_header=False,skip_column_header=False,skip_report_summary=False)


Vincent Racaza (AdWords API Team)

unread,
Jan 10, 2018, 4:25:12 AM1/10/18
to AdWords API Forum
Hi Chaitanya,

It seems that there was a mistake on how you grouped the report parameters specifically the dateRange field (this should be under the selector field), that's why it generated an error. Please see sample code snippet below for your reference:

report = {
     
'reportName': 'Last 7 days CRITERIA_PERFORMANCE_REPORT',

     
'dateRangeType': 'CUSTOM_DATE',
     
'reportType': 'CAMPAIGN_PERFORMANCE_REPORT',
     
'downloadFormat': 'CSV',
     
'selector': {
         
'fields': ['CampaignId','CampaignName','ExternalCustomerId','Impressions','Clicks','Cost','Date'],
         
'dateRange': { 'min' : '20180101',
                         
'max' : '20180105'
         
}
     
}
}

Let me know if this works successfully after correcting your code.

Thanks,
Vincent
AdWords API Team
Reply all
Reply to author
Forward
0 new messages