Canvas API creating ModuleItem with type File - what to add for content? Folder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Im using canvas API trying to create a "File" module item (sometimes called "Dropbox") where student can both download some file to edit, and then upload up there edited file (the file is probably some quiz)
So I see that module item has. "File" type - I suspect thats what I want. Then the question is what to use for "content" - to then put in as "content_id". Folder seemed like the obvious choice. But when I created a folder and put the folders id in as the content id in my File module item I get the unfortunately not very informative (dreaded) error:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @mgibson2 thanks for posting in the community.
I understand that we are updating information in Modules via the API and I want to help clarify.
It sounds like your second post is more close to what you want, and it sounds like you were creating a file upload question within a quiz via API. This is what that API call looks like: https://canvas.instructure.com/doc/api/quiz_questions.html#method.quizzes/quiz_questions.create
However, I would advise to use the Assignment Item type instead of Quizzes. Manipulating the Assignment API would be much easier than trying to create each individual quiz question via API. https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.create
If you are creating an Assignment via Modules, we would refer to the create module item API:
https://canvas.instructure.com/doc/api/modules.html#method.context_module_items_api.create
That would be the API for creating an Assignment, which is the basic item for allowing students to upload their Files into a dropbox for you to grade. What are Assignments? (guide)
You would want to specify that Assignment to be online_upload if you are wanting to have your students be able to upload files into that Assignment.
Hope this helps!