File attachments via "post /checklists/checklist_id/import.(json|xml)"?

In the api docs at Open API | Checkvist, “Create list items”, the POST /checklists/checklist_id/import.(json|xml) endpoint has an add_files[1] key which it seems can be used to import file attachments via the API.

What’s the format for the attachment data (assuming I’ve read correctly that this is possible)? I examined some exports, thinking they might model the format to follow, but they seem to have urls or refs to existing files (S3 objects?), depending on the export format.

Can files be attached base64 encoded, or perhaps via url?

Hello Crispin,

I’m sorry I’ve just noticed this post. I forgot to enable notifications for this category :frowning:

The format for this parameter is the same as produced by <input type="file" name="add_files[1]"> HTML input element. Or the one produced by FormData.append if you build the data with Javascript.

Hope this answers the question.

Kind regards,
KIR

1 Like

No worries Kirill - I suspect if I had got back to working on this I would have figured it out with a bit of experimentation. Thanks for the info in any case - yes it’s what I needed to know & will be helpful if/when I do get back to it. Cheers.