Component Definition Query
Retrieve MDL definitions (mdl_definition__v) and JSON definitions (json_definition__v) of Vault components using a VQL query on the vault_component__v and vault_package_component__v query targets. Learn more in the VQL documentation.
POST
/api/{version}/query/componentsHeaders
Section link for Headers| Name | Description |
|---|---|
Accept | application/json (default) or application/xml |
Content-Type | application/x-www-form-urlencoded or multipart/form-data |
X-VaultAPI-RecordProperties | Optional: If present, the response includes the record properties object. Possible values are all, hidden, redacted, and weblink. If omitted, the record properties object is not included in the response. Learn more. |
Body Parameters
Section link for Body Parameters| Name | Description |
|---|---|
qrequired | A VQL query on the vault_component__v or vault_package_component__v query targets. The query can be up to 50,000 characters, formatted as q={query}. For example, q=SELECT id FROM vault_component__v. Note that submitting the query as a query parameter instead may cause you to exceed the maximum URL length. |
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
--data-urlencode "q=SELECT id, mdl_definition__v FROM vault_component__v WHERE component_type__v = 'Reporttype'"
https://myvault.veevavault.com/api/v25.1/query/componentsResponse
Section link for Response{
"responseStatus": "SUCCESS",
"responseDetails": {
"pagesize": 1000,
"pageoffset": 0,
"size": 3,
"total": 3
},
"data": [
{
"id": "0CD000000000111",
"mdl_definition__v": "RECREATE Reporttype binder_section_with_document_and_bind__v (\n label('Binder Section with Document and Binder'),\n active(true),\n description(),\n primary_object('binder_section'),\n primary_objects(),\n configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n <vrt:upRelationships>\n <vrt:upRelationship key=\"binder_section.root_binder_id__v\" />\n </vrt:upRelationships>\n <vrt:downRelationships>\n <vrt:downRelationship key=\"documents\" />\n </vrt:downRelationships>\n</vrt:reportType>\n}),\n class('Standard')\n);"
},
{
"id": "0CD000000000112",
"mdl_definition__v": "RECREATE Reporttype binder_with_document__v (\n label('Binder with Document'),\n active(true),\n description(),\n primary_object('binder'),\n primary_objects(),\n configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n <vrt:downRelationships>\n <vrt:downRelationship key=\"documents\" />\n </vrt:downRelationships>\n</vrt:reportType>\n}),\n class('Standard')\n);"
},
{
"id": "0CD000000000113",
"mdl_definition__v": "RECREATE Reporttype product_with_document__c (\n label('Product with Document'),\n active(true),\n description('Product with Product (Document)'),\n primary_object('product__v'),\n primary_objects(),\n configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n <vrt:downRelationships>\n <vrt:downRelationship key=\"documents.product__v\" />\n </vrt:downRelationships>\n</vrt:reportType>\n}),\n class('Standard')\n);"
}
]
}Response Details
Section link for Response DetailsOn SUCCESS, the response includes the following information: