cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Unset allowed_extensions using API

How do I unset an assignment's allowed_extensions using the API? I have tried everything I can think of, from null to empty quotes, to empty lists. I'm using the update endpoint in assignments (https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.update). The web interface works by unchecking "Restrict File Upload Types."

Labels (2)
0 Kudos
2 Replies
Highlighted
Surveyor II

I believe you're using the built-in Canvas API (/doc/api/live#!) test tool to test?

Leaving the value blank works for me https://youracademy.instructure.com/api/v1/courses/*/assignments/*?assignment[allowed_extensions]=

A better tool to test API is Postman

Highlighted

I had initially had trouble setting an assignment to accept all filetypes using the Python canvasapi, and decided to try to the Live API. I tried leaving the field blank on the live API, and it didn't work. It appears to only send data from fields that are not blank. I tried empty quotes ("" and ''), brackets and braces ([], {}), the word None... nothing works.

You're right that Postman is better overall. I just like the documentation and quick boxes of the live one. Here may be a case where the live API cannot do what I want it to. Thanks for the suggestions @jerry_nguyen . Using POST with allowed_extensions=[] ought to work.

I did figure out how to do it with the Python canvasapi, something like

assignment.edit(assignment={'allowed_extensions':''}

.

Tags (2)