[ARCHIVED] User profile API call 401 error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.