Register for InstructureCon25 • Passes include access to all sessions, the expo hall, entertainment and networking events, meals, and extraterrestrial encounters.
I have a peculiar problem where I am attempting to view submissions for multiple assignments using the Submissions API below:
/api/v1/courses/:course_id/students/submissions
https://canvas.instructure.com/doc/api/submissions.html
I am an account admin, and I'm able to query for submissions using most every other API on the submissions page. However, when I try to get multiple submissions for multiple assignments, I keep getting:
{"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]}
At the moment, I'm just using a developer key. I've tried using multiple clients (browser, curl, etc.) with no luck. My key is not 'scoped'. I've created new keys. I made sure that I'm in no other 'account roles', in case that was an issue.
I'm not sure what else to look at. Any ideas out there?
Solved! Go to Solution.
Since you are an admin, you must specify the student ID to fetch the results for (see second sentence below):
student_ids[]: List of student ids to return submissions for. If this argument is omitted, return submissions for the calling user. Students may only list their own submissions. Observers may only list those of associated students. The special id “all” will return submissions for all students in the course/section as appropriate.
Try adding ?student_ids[]=all
If it still doesn't work, then you can look at keys and the like, but this is exactly what I experience when I don't specify the student_ids[] to view using a regular admin token.
Since you are an admin, you must specify the student ID to fetch the results for (see second sentence below):
student_ids[]: List of student ids to return submissions for. If this argument is omitted, return submissions for the calling user. Students may only list their own submissions. Observers may only list those of associated students. The special id “all” will return submissions for all students in the course/section as appropriate.
Try adding ?student_ids[]=all
If it still doesn't work, then you can look at keys and the like, but this is exactly what I experience when I don't specify the student_ids[] to view using a regular admin token.
To interact with Panda Bot in the Instructure Community, you need to sign up or log in:
Sign In
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.