Export Object Record Attachments
Export attachments in bulk from the specified object records. This endpoint starts a job to create a tar.gz export file for later retrieval. A single export can include up to 100,000 attachment files and the size must not exceed 250 GB. Each attachment version counts as a separate file.
When the job has completed, use Retrieve Object Record Attachments Export Results to retrieve the job results and name of the export file.
/api/{version}/vobjects/{object_name}/attachments/actions/exportHeaders
Section link for Headers| Name | Description |
|---|---|
Accept | application/json |
Query Parameters
Section link for Query Parameters| Name | Description |
|---|---|
allVersions | To export all versions of each attachment, include a query parameter allVersions=true. If allVersions=false, the request exports only the latest version of each attachment. If omitted, defaults to false. |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{object_name} | The name of the object from which to export attachments. |
Body Parameters
Section link for Body ParametersInclude a JSON payload of up to 500 object records.
| Name | Description |
|---|---|
idrequired | The object record id field value. |
attachment_idsoptional | An array of attachment id field values to export. Maximum of 100 attachments per record. Omit this parameter to export all attachments on the record. |
Request
Section link for Requestcurl -X POST -H "Authorization: {AUTH_VALUE}" \
https://myvault.veevavault.com/api/v26.3/vobjects/product__v/attachments/actions/export \
--data '[
{
"id":"00P000000007001",
"attachment_ids":[3801,3802,3803]
},
{
"id":"00P00000000K002"
}
]'Response
Section link for Response{
"responseStatus": "SUCCESS",
"data": {
"job_id": 1221701,
"records": [
{
"responseStatus": "SUCCESS",
"data": {
"id": "00P000000007001"
}
},
{
"responseStatus": "WARNING",
"warnings": [
{
"warning_type": "INVALID_DATA",
"message": "No attachments found for resource [00P00000000K002]"
}
]
}
]
}
}Response Details
Section link for Response DetailsOn SUCCESS, the response includes the job ID and job status for each record in the request. If the job runs for more than 23 hours, the job request terminates. Vault skips this job if there are no attachment files on the requested records or if all of the request data is invalid. Partial success is allowed, meaning the export of some object record attachments may succeed while others fail.