Found this content helpful? Log in or sign up to leave a like!

Users Last Login - API CAll

Jump to solution
MatthewKerr
Community Member

Our institution wants to check to ensure instructors are logging in to their Online Learning courses and not just letting the course run it self. I've been using python and the canvasapi library for most of the reports we've been making. For this one I can't seem to pull the users last login date/time.

Even when using the GET/api/v1/users/self call, the user object returned does not contain the last login. In the api documentation (On this page for what "An User object looks like": https://lms.au.af.edu/doc/api/users.html#method.users.api_index) it lists the last login as "Optional: This field is only returned in certain API calls"

What can I do to be able to get this field when using api calls?

Labels (1)
1 Solution
mzimmerman
Community Coach
Community Coach

Hi @MatthewKerr,

In the "Show user details" API (GET /api/v1/users/:id), the include[] parameter can request "last_login".  

(Per https://https://developerdocs.instructure.com/services/canvas/resources/users#method.users.api_index... )

View solution in original post