Create Object Record Attachment
Create a single object record attachment. If the attachment already exists, Vault uploads the attachment as a new version of the existing attachment. Learn more about attachment versioning in Vault Help
/api/{version}/vobjects/{object_name}/{object_record_id}/attachmentsHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | multipart/form-data |
Accept | application/json (default) or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{object_name} | The object name__v field value (product__v, country__v, custom_object__c, etc.). |
{object_record_id} | The object record id field value. |
File Upload
Section link for File UploadTo upload the file, use the multi-part attachment with the file component "file={file_name}". The maximum allowed file size is 4GB.
If an attachment is added which has the same filename as an existing attachment on a given object record, the new attachment is added as a new version of the existing attachment. If an attachment is added which is exactly the same (same MD5 checksum value) as an existing attachment on a given object record, the new attachment is not added.
The following attribute values are determined based on the file in the request: filename__v, format__v, size__v.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=my_attachment_file.png" \
https://myvault.veevavault.com/api/v22.2/vobjects/site__v/1357752909483/attachmentsResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data":
[{
"id": "558",
"version__v": 3
}]
}