Skip to content

Instantly share code, notes, and snippets.

@jkugler
Created December 9, 2010 21:36
Show Gist options
  • Save jkugler/735374 to your computer and use it in GitHub Desktop.
Save jkugler/735374 to your computer and use it in GitHub Desktop.
Populating a MS AdCenter report request
bsrr = client.factory.create('BudgetSummaryReportRequest')
bsrr.Format = 'Csv'
bsrr.ReturnOnlyCompleteData = True
bsrr.Language = "English"
bsrr.Time.CustomDateRangeStart.Year = 2010
bsrr.Time.CustomDateRangeStart.Month = 12
bsrr.Time.CustomDateRangeStart.Day = 1
bsrr.Time.CustomDateRangeEnd.Year = 2010
bsrr.Time.CustomDateRangeEnd.Month = 12
bsrr.Time.CustomDateRangeEnd.Day = 31
# The one that causes issues.
bsrr.Time.PredefinedTime = ''
bsrr.Columns = {'BudgetSummaryReportColumn':['AccountName', 'AccountNumber', 'CampaignName',
'CurrencyCode', 'Date', 'DailySpend', 'MonthlyBudget',
'MonthToDateSpend']}
# Another odd one. I had to assign to the .long element since AccountIds was
# an "ArrayOflong" Not quite sure why they couldn't define the Schema so you could
# assign directly to AccountIds
ars = client.factory.create('AccountReportScope')
ars.AccountIds.long = get_all_accounts(ac_soap, cfg)
bsrr.Scope = ars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment