Question:
Each document has different rendition files attached. Is there a way to retrieve the present Rendition Types for each document?
Answer:
The request can be achieved using the following VQL query in Vault REST API.
SELECT id, name__v, (SELECT rendition_type__sys, filename__sys FROM renditions__sysr) FROM documents
If specifying particular documents on a certain state is desired, add a WHERE clause on the state and document number, id, or name.
SELECT id, name__v, (SELECT rendition_type__sys, filename__sys FROM renditions__sysr) FROM documents WHERE status__v = steadystate() AND id CONTAINS (766,1084)
A sample response is shown below:
{
"responseStatus": "SUCCESS",
"responseDetails": {
"pagesize": 1000,
"pageoffset": 0,
"size": 2,
"total": 2
},
"data": [
{
"id": 727,
"name__v": "0072-",
"renditions__sysr": {
"responseDetails": {
"pagesize": 250,
"pageoffset": 0,
"size": 2,
"total": 2
},
"data": [
{
"rendition_type__sys": "viewable_rendition__v",
"filename__sys": "rendition.pdf"
},
{
"rendition_type__sys": "portal_rendition__v",
"filename__sys": "portalRendition_b_1.jpg"
}
]
}
},
{
"id": 821,
"name__v": "Document Type Change Test",
"renditions__sysr": {
"responseDetails": {
"pagesize": 250,
"pageoffset": 0,
"size": 2,
"total": 2
},
"data": [
{
"rendition_type__sys": "viewable_rendition__v",
"filename__sys": "rendition.pdf"
},
{
"rendition_type__sys": "large_size_asset__v",
"filename__sys": "largeSizeAsset_b_Success_history (1).csv"
}
]
}
}
]
}
Related Documentation:
- Vault Help Documentation: API - Submitting a VQL Query
- Vault Help Documentation: VQL - Querying Renditions