POST /feedback_portal/{portalId}/attachment
Changed onUpload a file so it can be attached to a piece of feedback.
Upload first, then submit. multipart/form-data with the file in a field named file. The response carries an id; pass it in attachmentIds on POST /feedback_portal/{portalId}/feedback or .../plain_feedback to file it with that submission. Call this once per file.
That order is not a preference. A form's file picker fires while the person is still writing, so there is no feedback item to attach to yet — and it means a failed upload costs a retry of one file rather than the whole submission.
Until a create call names it, the file belongs to the portal and to nothing else. It is not visible on any feedback item, and an id from a different portal is refused.
Limits. 20 MB per file, 10 files per feedback item. Executable and script types are refused (422 file_type_not_allowed), as is a file whose bytes do not match an image extension it claims (422 file_content_mismatch). Over the size cap is 413 file_too_large. Files are virus-scanned after this call returns; an infected file is removed along with its links.
Reading attachments back is not part of this release — this endpoint stores them; the portal and the Craft app display them.
Takes the same three credentials as the create routes: an account API key, a widget token, or a development key.
Request
- Base URLhttps://api.craft.io
- URLhttps://api.craft.io/feedback_portal/{portalId}/attachment
- AuthAPI key in header x-api-key
Path parameters
Request body multipart/form-data
Response
The stored file — pass its id in attachmentIds when you create the feedback item
Changes
- info
endpoint added
- info