[ARCHIVED] submissions API for multiple assignments

Jump to solution
gmsharpe
Community Explorer

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?

Labels (2)
0 Likes
1 Solution
James
Community Champion

 @gmsharpe ,

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.

View solution in original post