cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
HaoxinLi
Community Participant

Last activity time

Jump to solution

Hi all,

The application we are building wants to find out when was the last time a student accessed Canvas via Canvas REST API. Is there a third way to find out user's last activity time of using Canvas, other than:

1. page_view in the User API (unfortunately this is not possible for us as we do not have admin rights)

2. History API (certain clicks on Canvas are not recorded and we don't know which ones)

For example, we can find out the last time a student was active in a course, following the instructions ("Last Activity" of users)

image.png

image.png https://community.canvaslms.com/t5/Instructor-Guide/How-do-I-use-the-People-page-in-a-course-as-an-i...

Does anyone know how to get that information for a user for Canvas entirely (not just for a single course), and via REST API?

Thank you in advance 😀

Labels (2)
0 Kudos
1 Solution

Accepted Solutions
James
Community Champion

@HaoxinLi 

The last activity and total activity is available through the Enrollments API. It comes as the last_activity_at (in ISO8601 format) and total_activity_time (in seconds).

They are not reliable measures and do not catch all activity and catch some non-significant activity as well. I download the data daily so I can provide historical tracking, I will see the last activity change, but not the total activity time and that typically happens when someone is using the mobile app or spending less than 2 minutes in the course. That said, the information is still there from the enrollments API and you get it for an entire course or section or for an individual student.

View solution in original post

3 Replies
James
Community Champion

@HaoxinLi 

The last activity and total activity is available through the Enrollments API. It comes as the last_activity_at (in ISO8601 format) and total_activity_time (in seconds).

They are not reliable measures and do not catch all activity and catch some non-significant activity as well. I download the data daily so I can provide historical tracking, I will see the last activity change, but not the total activity time and that typically happens when someone is using the mobile app or spending less than 2 minutes in the course. That said, the information is still there from the enrollments API and you get it for an entire course or section or for an individual student.

View solution in original post

HaoxinLi
Community Participant

Hi James,

Thank you so much for your help!

I investigated into the Enrollment API and found that the latest last_activity_at  for me was in July, 2021.  However, I am a student of my institution who access Canvas frequently in this semester (and definitely in August and September).   I have tried changing the state[] parameter in my requests (using user_id), but no fruitful results.

Do you perhaps know where I went wrong?  Or perhaps this reflect what you said about it being unreliable and does not record all activities 🤔

Thank you again for helping us!

HaoxinLi
Community Participant

I found the problem - if I increase the number of items returned for the paginated list, I can see last_activity_at in September, matching my current enrollments.

Thank you again James!