Automating usage report ingest
We are working on pulling in usage information from Panopto as part of our learning analytics offering for the new academic year. We are looking at using the viewing of a session in place of a physical attendance check in, so are hoping to automate as much as possible.
We've made good progress and have the reports from the system bu we want to work out how we can automate the final step of the data import process, and pick up the daily reports we are creating automatically. I assume it's a case of passing the correct report type to the GetRecentReports SOAP command, but the PHP library doesn't seem to contain the defined types for our Session and System reports, and my guesses at what the values could be didn't seem to work either. I've tried this: https://support.panopto.com/resource/APIDocumentation/Help/html/7de68277-7586-8a8f-e9fc-d2edce3e9e8f.htm
At the moment I have to cut and paste the report IDs from the email notifications for each type of report into the appropriate place in the code.
I've used both the Panopto PHP API library and a manually crafted SOAP call and both return empty results. Here's my manual call:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetRecentReports xmlns="http://tempuri.org/">
<auth
xmlns:a="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
>
<a:AuthCode i:nil="true"/>
<a:Password>password</a:Password>
<a:UserKey>api-warehouse</a:UserKey>
</auth>
<reportType>SessionsViewsByViewingType</reportType>
</GetRecentReports>
</s:Body>
</s:Envelope>
I was expecting X recent StatsReportStatus elements, but the result is empty:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetRecentReportsResponse xmlns="http://tempuri.org/">
<GetRecentReportsResult xmlns:a="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
</GetRecentReportsResponse>
</s:Body>
</s:Envelope>
I must be missing something, somewhere, but both the library and the manual version do the same, so I'm a bit confused. Maybe it's a permissions issue? I created the daily reports using the same api-warehouse user, though.
If I change the reportType to something invalid it errors out (e.g. I've tried the numeric equivalent of the type, 6), so the request looks to be parsed correctly in the API it just doesn't give us any results.
Any guidance welcome!
Answers
Hi Richard,
May I ask what PHP library you are referencing? I believe we have PHP samples for SessionManagement, UserManagement, and Auth APIs but none of those would include an example for GetRecentReports. Also those samples may be out of date and recent functionality additions might not be reflected there.
For the empty data you are receiving I am wondering you could check to see if any reports of the type you are requesting actually exist?
You can check this from the web UI at /Panopto/Pages/Admin/Usage.aspx#modalPage="UsageGenerateReport"
If the report does exist then I would ask if you are either an admin in Panopto or the user who requested the report? Those are the only 2 users who can get a report.
If that is true then the last thing I would check is if the report is older than a week? Our API will only return reports from the last week.
Thanks,
Joe Malmsten
Thanks Joe. The problem is that there aren't any examples for what we want to do.
The reports exist and are being generated every night. The user who requested the report is the one who is being used to retrieve it via the API, and the reports are generated correctly every night. We are trying to retrieve them automatically each day. It works manually (we can download them each morning) but we want to automate the last step of downloading the report so we can ingest the data.
We've been using these examples:-
https://github.com/Panopto/UsageReportingDownloadsExample
It must be possible to do what we want to do, it just doesn't seem to be documented anywhere! We really need a solution to this in the next few weeks.
Rich
Hi Rich,
I think you've identified the correct stats report enumeration. The UsageReporting example you linked above is also the current best approach; there's a similar python example here in case that helps you: https://github.com/Panopto/python-soap/blob/master/examples/stats_report_example.py
You probably know this already, but the full SOAP APIs are documented here: https://support.panopto.com/resource/APIDocumentation/Help/html/fa25b91c-9b25-a5cf-7c68-d79cd748a05b.htm
If you remain stuck after reviewing those, please contact your Customer Success rep or else open a support ticket so we can look into the particular details of your reporting setup.
Thanks,
Mark
My rep directed me here as he thought that I would be able to get an answer, so it will have to be a support case I suppose.
Rich