Happy Tuesday everyone! If you have ever exported a download statistics report from the Management Portal and wished you could just get those numbers straight into your own dashboard or spreadsheet, this week’s post is for you. DownloadReports is fully scriptable, filters and all.
1 - Define the report
Start by creating the report definition itself. This is where all your filtering happens, date range, folders, channels, even specific presenters or users:
POST/api/v1/DownloadReports
Body: {
"Name": "Weekly download stats",
"DateRangeType": "LastWeek",
"IncludeItemsWithZeroDownloads": false,
"IncludeSubFolders": true,
"FolderIdList": ["your-folder-id"]
}
DateRangeType accepts Custom, Today, LastWeek, LastMonth, LastYear, AllDates, or Yesterday. If you use Custom, you will also need to set DateRangeCustomStartDate and DateRangeCustomEndDate. You can filter by PresentationIdList, FolderIdList, CatalogIdList, PresenterList, or UserList, all optional, all combinable.
2 - Run it
Creating the report just defines it, it doesn’t run it. To actually execute it and get results, call Execute on the report’s Id:
POST/api/v1/DownloadReports('reportId')/Execute
This runs in the Job Farm rather than instantly, since reports can take a moment to crunch through. The response gives you a job ID along with a URL you can poll to check on progress, and a URL to launch the result once it’s ready. You can optionally override the date range at execution time without touching the saved report definition, using DateRangeTypeOverride and the matching custom start and end dates.
3 - Export it, if you want a file
If you would rather have a downloadable file than parse the raw result yourself, there is a separate Export action:
POST/api/v1/DownloadReports('reportId')/Export
Body: {
"ResultId": "the-result-id-from-execute",
"FileFormat": "Excel"
}
FileFormat accepts Excel or Xml, defaulting to Xml if you leave it out. Like Execute, this kicks off a Job Farm task and gives you a URL to download the file once it’s done.
Worth knowing: a report definition created this way is reusable. Save the Id once and you can call Execute against it on a schedule, weekly, monthly, whatever suits, rather than rebuilding the filters every time. There is also a ReportRecurrence sub-resource if you want Mediasite itself to run and email the report on a recurring schedule, no external scheduler needed.
Anyone already pulling reports like this into their own dashboards? Curious what you have built on top of the numbers. Drop it below.



