AnsweredAssumed Answered

How to specify multiple 'file_ids' in API call?

Question asked by DJ Rao on Jun 28, 2016
Latest reply on Jun 28, 2016 by DJ Rao

Hello,

 

I am able to successfully submit 1 file (via POST /api/v1/courses/:course_id/assignments/:assignment_id/submissions) for an Assignment (of type online_upload). It works as expected.

 

However, I am unable to submit 2 (or more) files for an Assignment. No matter what combination I try (that is, comma separated, blank separated, in square-brackets, without square-brackets, etc.)  Here is the request that I am currently trying:

curl 'https://test.instructure.com/api/v1/courses/27332/assignments/229429/submissions' \
    -F 'comment[text_comment]=This is assignment submission with 2 files in it' \
    -F 'submission[submission_type]=online_upload' \
    -F 'submission[file_ids][]=3088689, 3088688' \
   -H 'Authorization: Bearer  BigTokenString'

The submission is created but with just the first file. The second file (id 3088688) is not included in the submission as shown in the screenshot (part of Canvas web application) below:

I will be thankful if some one could help me figure out what is the correct format to be used to submit multiple files as part of a submission.

Outcomes