Upload attachment

Uploads an attachment

Before a record can be updated with an attachment, the actual attachment must be uploaded to the server.

Request

POST https://www.activityinfo.org/resources/form/{formId}/record/{recordId}/field/{fieldId}/blob

Request body

multipart/form-data

blobId string A client-generated unique identifier for the attachment, matching the pattern [a-z][a-z0-9]{0,25} and unique within the form.
file binary The contents of the attachment

Response

Status Code Error Code Description
200 OK
400 INVALID_BLOB_ID The 'blobId' format is not compliant with the required pattern of [a-z][a-z0-9]{0,25}
400 MISSING_ATTACHMENT Request is missing ‘file’ part with contents of attachment.
400 MISSING_ATTACHMENT_ID Request is missing ‘blobId’ part with unique id of attachment.
401 AUTHENTICATION_REQUIRED The request must be authenticated
403 COLLECTION_LINK_CLOSED The collection link has been closed, and no uploads can be made.
403 MISSING_ADD_OR_EDIT_PERMISSION Users must have ADD_RECORD or EDIT_RECORD to stage an attachment
404 ATTACHMENT_NOT_FOUND
404 COLLECTION_LINK_NOT_FOUND
404 FORM_NOT_FOUND
409 ATTACHMENT_ALREADY_EXISTS An attachment with this id already exists.