Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lsloan
Community Member

API: Download all assignment submissions?

Does the Canvas API provide an entry for downloading all submissions for an assignment as a single file?  I see that's available in the Canvas UI.  Instructors can click a link to download all submissions as a single ZIP file.

I maintain a program that occasionally needs to download all submissions for specific assignments.  Sometimes the course size is large (1800+ students).  Downloading each submission takes at least two HTTP requests.  When all/most of the students of a large course make submissions for an assignment, then that means 3600+ requests are being made.  This can take several minutes to complete (I timed it at 18+ minutes one time).

I've looked through the Canvas Live API for an entry to download all submissions, but I didn't find one.  Does anyone know if such a thing exists?

Bonus:  This goes along with an earlier question I asked about getting submissions as PDF.  If it were possible to download all assignment submissions as PDFs in a single ZIP file, that would be even better.

0 Kudos
1 Reply
James
Community Champion

lsloan

 

The call made through the UI when you download all assignments is not made through the API. If it were, it would be a operation that started the compiling and then you would have to poll it, checking the progress until it was done. Normally when internal calls are made, it's because there is no API call for it. In this case, I don't recall seeing any API call for that. Sometimes similar calls will work in the API that work for internal routes, but not in this case.

It is possible to get the PDFs, but not in a single file unless they were uploaded as PDF to start with. See Download annotated submissions via API for more information.

Downloading each submission takes at least two HTTP requests.

What two API calls are you using? You can fetch up to 100 submission filenames at one time and then it will take an HTTP request to download each one. That sounds more like 18+1800=1818 http requests.