Retrieve Document Relationships
Retrieve all relationships from a document.
GET
/api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}/relationshipsHeaders
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. |
{major_version} | The document major_version_number__v field value. |
{minor_version} | The document minor_version_number__v field value. |
Request
Section link for Requestcurl -X GET -H "Authorization: {SESSION_ID}" \
https://myvault.veevavault.com/api/v17.2/objects/documents/866/versions/1/1/relationshipsResponse
Section link for Response{
"responseStatus": "SUCCESS",
"responseMessage": null,
"errorCodes": null,
"relationships": [
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "related_pieces__c",
"created_date__v": "2015-12-15T21:42:01.000Z",
"id": 214,
"target_doc_id__v": 890,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "related_pieces__c",
"created_date__v": "2015-12-15T22:06:28.000Z",
"id": 216,
"target_doc_id__v": 884,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "supporting_documents__c",
"created_date__v": "2015-12-15T21:41:10.000Z",
"id": 213,
"target_doc_id__v": 885,
"created_by__v": 46916
}
},
{
"relationship": {
"source_doc_id__v": 886,
"relationship_type__v": "supporting_documents__c",
"created_date__v": "2015-12-15T22:06:21.000Z",
"id": 215,
"target_doc_id__v": 889,
"created_by__v": 46916
}
}
],
"errorType": null
}Response Details
Section link for Response DetailsOn SUCCESS, Vault returns a list of all relationships configured on the document. In this example, document ID 886 v1.1 has reference relationships with four other documents in our Vault. This is the source document. Two of the referenced documents - target_doc_id__v 890 and 884 have the related_pieces__c relationship type. The other two referenced documents - target_doc_id__v 885 and 887 have the supporting_documents__c relationship type.