What permission for /api/v1/users/:id ?

Jump to solution
lesley_de_keyse
Community Novice

Dear,

I'm creating an app for Canvas as a project for my college and I'm encountering a problem.

When requesting a user, other than the authenticated user, I get "user not authorized to perform that action".

I would like to get the userId and name of other users too. If possible also the email.

I could store every user in my own database once logged into my application, but that would be a bad solution in my opinion. Can I retrieve these values? If so what permissions/roles do I need to give the user?

I would say that because Students and Teachers have the "Users - view list" course role it would work out of the box but apparently not.

Thank you very much,

Lesley

Labels (2)
0 Likes
1 Solution
jsavage2
Community Contributor

HI Lesley,

The users endpoint lets you look up any users, not just users in your own courses, and far more information than is available in the “People” view of a course that students and teachers typically see. It’s restricted to admins with the “Users – view list” permission at the account level, not students and teachers with the view list course permission for particular courses.

If you want mimic the functionality of the “People” view and let users see other users in rosters they have access to, you probably want to look at the “List users in a course” action of the Courses endpoint: https://canvas.instructure.com/doc/api/courses.html#method.courses.users

I hope this helps,

--j

View solution in original post