How to Get Student File Submission to Quiz Questions using API

MManshad
Community Member

I am able to get attachment_ids for any file students attached to file-upload based questions on a quiz, using the following request:

https://canvas.instructure.com/api/v1/courses/XX/assignments/XX/submissions?include[]=submission_his...

As part of the response to above request, I receive the following JSON fragment for any file student uploaded:

{ "correct": "defined", "points": 50.0, "question_id": QUESTIONID, "attachment_ids": ["ATTACHMENTID"], "more_comments": "" }

I then tried to use ATTACHMENTID making use of files but received 404 response: https://canvas.instructure.com/api/v1/courses/XX/files/ATTACHMENTID

{ "errors": [{ "message": "The specified resource does not exist."}]}

What is the correct way to get a file object as a response based on ATTACHMENTID?

0 Likes