Add or Update Attachments
Use this API to add attachments to records. You can send multiple files within the same multipart request. Files with identical names sent more than once overwrite and update the associated attachments.
Method
POST
URL
/v2/<object_full_identifier>/<record_uuid>/attachments
Parameters
document_id: If specified with an existing attachment's UUID, the document version is updated with the content of the file sent in the request body.
Response Content Type
application/json
Input Example
Following is an example of how to send a multipart request (Content-Type = multipart/form-data) that contains the files to attach, which are sent as sections in a multipart document in the body. The input should be a POST request with the following URL:
POST https://localhost:8080/v2/io_showcase/42f64596-c42f-4ba2-8138-cc40188d2a88/attachments
Response Example
The response is a JSON array that represents the attachments added and versions updated, with URLs that honor HATEOAS. Following is an example Status Code 200 response:
[{
"updated_on":"1480085367917",
"size":"314",
"media_type":"application/rtf",
"version_uuid":"28d28b95-277e-4d8b-98c7-0777b4d810c5",
"name":"file1.txt",
"links":[
{ "rel":"url",
"href":"https://localhost:8080/document/e74f0eff-ed37-4d72-9410-01977c5199e5/latest?148008536791"
}
{ "rel":"thumbnail_url",
"href":"https://localhost:8080/document/3b156bad-81fd-4c86-9624-50c4f7cdb71d/latest?5.0.0.620-SNAPSHOT"
}],
"type":"file",
"uuid":"e74f0eff-ed37-4d72-9410-01977c5199e5"
},
{
"updated_on":"1480085367917",
"size":"310",
"media_type":"application/rtf",
"version_uuid":"71e5b04f-3f41-480d-8a71-74fcb28f1600",
"name":"file2.text",
"links":[
{ "rel":"url",
"href":"https://localhost:8080/document/ef39b3db-01ce-4a72-aa28-f3af91917245/latest?1480085367917"
}
{ "rel":"thumbnail_url",
"href":"https://localhost:8080/document/3b156bad-81fd-4c86-9624-50c4f7cdb71d/latest?5.0.0.620-SNAPSHOT"
}],
"type":"file",
"uuid":"ef39b3db-01ce-4a72-aa28-f3af91917245"
}, ...
]
Error Response Messages
HTTP Status Code
Error Message
400
The object identifier or record UUID were not specified or are invalid
404
The record specified to add attachments to was not found (or user has no permission to access it)
500
Internal Server error
For more information:
Was this helpful?