AnsweredAssumed Answered

GET user profile called by Instructor returning "unauthorized" response?

Question asked by Akshya Pandey on Jan 28, 2019
Latest reply on Jan 28, 2019 by Stefanie Sanders

Hi There!

 

I'm a developer of an Attendance-taking LTI app that makes use of Canvas' REST APIs. When instructors open our tool in their course, they see their enrolled users in that course with an interface allowing them to take attendance for their students.

 

When before loading a courses' data, the tool authenticates the current user using authentication APIs, and the provided access token is used to run the API requests. I am running into a bit of an issue in one of the courses that my client reported to me, I am unable to retrieve some students' information as an instructor.

 

I am using GET|/api/v1/users/:user_id/profile to load individual users' data. 

 

For some users in a course when I am an instructor, I am seeing this response to the aforementioned API request - {"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]}

 

The erroneous course in question has about 30 users, with 5 or so inactive. So I expect to be seeing about 25 users, however I am only seeing the "test student" accounts in the course that were made earlier. The other users have already accepted the invitation to the course. The course is also unpublished.

 

Any help on finding a solution to this issue is appreciated! Thank you.

Outcomes