How to search for users by login_id?

315 views
Skip to first unread message

jho...@gmail.com

unread,
Aug 8, 2014, 4:38:32 PM8/8/14
to canvas-l...@googlegroups.com
I'm attempting to search for users with a known login_id using the accounts endpoint:

GET /api/v1/accounts/:account_id/users


Per the API docs I can specify a search_term consisting of "the partial name or full ID of the users to match and return in the results list."  (Emphasis mine.) I find that if I use a login_id as the search term, Canvas returns lots of partial matches. For example:

GET /api/v1/accounts/:account_id/users?search_term=jones


Returns:

[{ id: 1, login_id: jones },
 
{ id: 2, login_id: jonesy },
 
{ id: 3, login_id: ajones },...]


Is it possible to restrict this search_term to an exact match? And in any case, is there a better way to search for users by login_id?

Steve Hillman

unread,
Aug 8, 2014, 6:38:36 PM8/8/14
to canvas-l...@googlegroups.com
If you're making use of SIS import to get your data into Canvas, such that they have an sis_login_id parameter, then this will work to fetch a specific user whose login ID is "jones":

GET /api/v1/users/sis_login_id:jones/profile


--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hillman        IT Architect
hil...@sfu.ca       IT Services
778-782-3960         Simon Fraser University

jho...@gmail.com

unread,
Aug 11, 2014, 10:47:22 AM8/11/14
to canvas-l...@googlegroups.com
That worked great -- thanks!
Reply all
Reply to author
Forward
0 new messages