Determine if a Document has Attachments
GET
/api/{version}/objects/documents/{doc_id}Headers
Section link for Headers| Name | Description |
|---|---|
Accept | application/json (default) or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{doc_id} | The document id field value. |
Request
Section link for Requestcurl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v17.1/objects/documents/565Response (abridged)
Section link for Response (abridged){
"attachments": [
{
"id": 566,
"url": "https://myvault.veevavault.com/api/v17.1/objects/documents/565/attachments/566"
},
{
"id": 567,
"url": "https://myvault.veevavault.com/api/v17.1/objects/documents/565/attachments/567"
}
]
}Response Details
Section link for Response DetailsShown above, document id 565 has two different attachments: id 566 and id 567. Note that this endpoint does not retrieve the number of versions of each attachment nor the attachment metadata. The "attachments" attribute is displayed in the response for documents in which attachments have been enabled on the document type (even if the document has no attachments).