Skip to content

How do I list users then terminate a user's sessions? #593

Discussion options

You must be logged in to vote

Yes, you can use that first endpoint to find the user. The search_term kwarg can be used and it should be as specific as possible, like a full email address. From the Canvas docs (my emphasis added):

It will only search against other fields if non-numeric in form, or if the numeric value doesn't yield any matches. Queries by administrative users will search on SIS ID, Integration ID, login ID, name, or email address.

So, if you know your user's email address, you can do something like this:

# Set up your canvas instance, etc
account = canvas.get_account(1)
user = account.get_users(search_term="myemail@example.com")

# get_users returns a paginated list, so you can check by iterating
# I…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by sayerbartlett
Comment options

You must be logged in to vote
2 replies
@bennettscience
Comment options

@sayerbartlett
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants