Export Attachment Field Files
Export all Attachment field files in bulk from the specified object records. This endpoint starts a job to create a tar.gz export file for later retrieval.
When the job has completed:
- Use Retrieve Attachment Field Files Export Results to retrieve the job results and name of the export file.
- Use Download Attachment Field Files Export to download the export file.
POST
/api/{version}/vobjects/{object_name}/attachment_fields/actions/exportHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json or text/csv |
Accept | application/json (default) or application/xml |
Query Parameters
Section link for Query Parameters| Name | Description |
|---|---|
field_names | A comma-separated list of Attachment field names from which to retrieve attached files. If omitted, retrieves files from all Attachment fields on the object. |
idParam | If you’re identifying attachments in your input by a unique field, add idParam={fieldname} to the request endpoint. You can use any object field with unique set to true in the object metadata, with the exception of picklists. For example, idParam=external_id__v. |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{object_name} | The name of the object from which to retrieve Attachment field files. |
Body Parameters
Section link for Body ParametersInclude up to 500 object records as JSON or CSV.
| Name | Description |
|---|---|
idconditional | The ID of the record from which to retrieve Attachment field files. Not required if providing a unique field identifier (idParam) such as external_id__v. |
{fieldname}conditional | The unique field name to use instead of the id. You must also add the idParam query parameter, such as idParam=external_id__v. |
Request
Section link for Requestcurl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v25.3/vobjects/product__v/attachment_fields/actions/export?field_names=attachments__c' \
--data ''[
{
"id": "00P000000000201"
},
{
"id": "00P000000000202"
}
]'Response
Section link for Response{
"responseStatus": "SUCCESS",
"data": {
"records": [
{
"responseStatus": "WARNING",
"warnings": [
{
"warning_type": "INVALID_DATA",
"message": "No attachment field values found for resource [00P000000000201]"
}
]
},
{
"responseStatus": "SUCCESS",
"data": {
"id": "00P000000000202",
"id_param_value": "00P000000000202"
}
}
],
"job_id": 1069401
}
}Response Details
Section link for Response DetailsThis endpoint generates a job request. If the job runs for more than 23 hours, the job request terminates. Vault skips this job if there are no Attachment field files on the requested records or if all of the request data is invalid. Use the Retrieve Job Status endpoint to monitor the job.
On SUCCESS, the response includes the following metadata:
| Name | Description |
|---|---|
job_id | The job’s ID. |
records | A list of the records from which to export Attachment field files and their responseStatus. |