Is it possible to add attachments to Canvas Conversation via the API?

Jump to solution
justin_lee
Community Explorer

Use case: An instructor wants to send individual messages to each student in the course a scanned copy of the midterm/final exam. 

I've been looking for a way to upload attachments via the API. The documentation shows it's possible to add attachment IDs, as there is a "attachment_ids[]" param. It says these IDs comes from files previously uploaded to the “conversation attachments” folder. 

 

It sounds like Joshua here was able to upload via the API to the conversation attachments folder: https://community.canvaslms.com/thread/20969-api-problem-attachments-in-create-conversations 

I would really appreciate any pointers!

1 Solution
pklove
Community Champion

To upload the file using the API you need to follow the procedure at Uploading Files - Canvas LMS REST API Documentation 

Then you get the id and use that with the attachment_ids[].

If you want to try the conversation bit out first without doing the file upload via the API, you can simply upload a file via the GUI and use its id in the attachment_ids[].

View solution in original post