How can the entire district's user access log data be downloaded for all active terms for students through the API?
I have a need to download weekly the user access log report for students but we have courses on quarter, semester, and annual basis. Can this report be accessed through the API so I can schedule download the report for each term and concatenate for use in a data warehouse system?
It seems Canvas has done the heavy lift of creating the report. We just need more flexible access to it.
Thanks for any help!
The User Access report is not available through the API. It is an internal AJAX call that is not exposed via the API. That means that if you are logged into Canvas, that you could fetch the data. You could use a headless browser to simulate being logged into Canvas and then do it.
I have two solutions.
As a teacher, I use a script that I wrote that downloads all of the access reports for an entire course as a CSV file that you can open with Excel.
As an administrator / programmer, I set up Canvas Live Events (Admin > Data Services) to send an event to an AWS SQS queue every time a student does something. I use an Asset subscription for asset_accessed. That tells me when the student viewed something. I also have subscriptions for conversation, discussion entry, discussion topic, quiz, submission comment, and submission. Basically, the things that show the students doing something.
I wrote a script that will query the SQS queue from Amazon and download the events to a local database where it is massively huge and I need to trim it. It's huge because I'm doing this for the entire college, but it will pale in comparison to some people because we're a relatively small school. Since AWS gives you 1 million free requests per month, it's actually fairly cheap for us. Since I don't have an official budget from the school, I just put it on my own credit card and my highest bill so far has been $1.25 for the month. Like I said, we're small.
But from that database, I can come up with a semblance of an access report for all of the users for the college.
I was originally going to set it up just for my courses because I wanted to know what my statistics students were doing (or not doing), but couldn't figure out how to do that in time before the classes in August 2020, so I just went ahead and did it for the whole college. It's turned out to be helpful on the administrative side, but there are some things I could have turned on that would have been helpful when faculty claim they did something and it's the student fault when they really didn't. All in all, it's been a good investment. I just don't use it as much as I would like because of the sheer volume of information in raw form. I could organize it better and archive old data, but it hasn't been a high enough priority for me.
Note that there is a disclaimer with Live Events that they will attempt to send the event once. If it's not delivered, then you lose it. So it's not as reliable as the information inside Canvas through the access log, but it encompasses more than one student at a time (or an entire course at a time if you use my script).