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

Find user in Canvas if given their name?

Jump to solution

I'm creating a custom web application for my university that allows users to search for a single user in Canvas.

I've studied the documentation here: https://canvas.instructure.com/doc/api/users.html#method.users.api_index
From what I understand, I can get a single user if I have their ID. "GET /api/v1/users/:id"


However, in building my page, I am thinking of users who may not have the ID of the person they are thinking of: who may only have their name.

I am aware that the base Canvas site has this functionality. How do I use the People page in an account?  However, I am creating a custom page, that is its own application yet uses Canvas endpoints to use its data. Hence I need this new app to have this functionality.


I imagine I can search my entire directory of users until I find one with a matching name, but I also fear that'd have an incredibly heavy load.

Is there any other method I can use to find just one user?

Labels (3)
1 Solution

Accepted Solutions
bneporadny
Community Champion

Hi Lee,

I think you're on the right track with using the users api‌, but you may have over looked a functionality. Using the users api‌ you can actually search for users using the search_term‌ parameter‌. 

Users - Canvas LMS REST API Documentation 

331416_pastedImage_3.png

Hope this helps and is what you're looking for.

View solution in original post

3 Replies
bneporadny
Community Champion

Hi Lee,

I think you're on the right track with using the users api‌, but you may have over looked a functionality. Using the users api‌ you can actually search for users using the search_term‌ parameter‌. 

Users - Canvas LMS REST API Documentation 

331416_pastedImage_3.png

Hope this helps and is what you're looking for.

View solution in original post

sam_ofloinn
Community Participant

Brian, I had misunderstood that aspect while reading, it seems. That helps me noticeably, thank you. I'm able to simply call "https://my.test.instructure.com/api/v1/accounts/self/users?search_term=FirstName+Surname" and find a specific user that way.

Hi Lee,


Glad to hear this helped. Good luck with your project.