[ARCHIVED] User profile API call 401 error

Jump to solution
murthyt
Community Explorer

Using the below API to get user profile with certain canvas instance erroring with 401. Is there specific permission needed to get user profile? or any restricted permission throwing 401 error? User data is from SIS. User has authorized role and permissions. 

https://canvas.instructure.com/doc/api/users.html#method.profile.settings

Get user profileProfile
GET /api/v1/users/:user_id/profile
Scope: url:GET|/api/v1/users/:user_id/profile
Returns user profile data, including user id, name, and profile pic.

Error with certain Canvas instance:
failed canvas GET: 401
https://xxxxxxxx.instructure.com/api/v1/users/userID/profile

Labels (2)
0 Likes
1 Solution
A_K_Dekker
Community Participant

You need admin access to the account that the profile is in. In our Canvas environment all user profiles are in the root account, which means that subaccount admins cannot use the /api/v1/users endpoint. It's worth checking if the profiles you are looking for are actually in the account you have access to. 

 

Also make sure you use the Canvas id of the user, not your SIS ID. An invalid ID will also throw a 401 error for some reason.

View solution in original post