Bulk Update Node Order
Given multiple parent nodes across hierarchy-enabled objects, update the order of each set of children.
PUT
/api/{version}/composites/trees/{object_name}/batchHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json (default) or text/csv |
Accept | application/json (default) or application/xml or text/csv |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
object_name | The name of the corresponding hierarchy-enabled object for which to update the node order in bulk. For example, edl__v, edl_item__v, or edl_template__v. |
Query Parameters
Section link for Query Parameters| Name | Description |
|---|---|
idParamoptional | To identify nodes in your input by a unique field on the corresponding record, add idParam={field_name} to the request endpoint. You can use any record field that has unique set to true in the record metadata. For example, idParam=external_id__v. If idParam is included, parent_id and id are not required in the request body. |
Body Parameters
Section link for Body ParametersExpressed as a JSON or a CSV.
| Name | Description |
|---|---|
parent_idconditional | The parent node ID from the veeva_hierarchy_node table. Not required if idParam is included. If idParam is included, add parent_{field} as a unique field on the corresponding record instead. |
idconditional | The node ID from the veeva_hierarchy_node table. Not required if idParam is included. If idParam is included, add {field} as a unique field on the corresponding record instead. |
order__vrequired | An integer specifying the sibling ordering, indexed at 1. |
{field_name}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. |
parent_{field}conditional | The unique field name on the corresponding parent record to use instead of the parent_id. This field name should match the input of the idParam query parameter with a parent_ prefix. |
Error Handling
Section link for Error HandlingIf any child node update fails for a given parent, all children of that parent fail. Updates for other parent nodes still proceed.
On partial failure, the response includes both SUCCESS and FAILURE entries in the data array. Results are sorted by responseStatus (successes first), then by parent_id, then by order__v.
Request
Section link for Requestcurl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
-d '[{"parent_id": "0000000000000AYI", "id": "0000000000000JLL", "order__v": 2}]' \
https://myvault.veevavault.com/api/v26.3/composites/trees/edl_template__v/batchResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": [
{
"responseStatus": "SUCCESS",
"data": {
"parent_id": "0000000000000AYI",
"id": "0000000000000JLL",
"order__v": 1
}
}
]
}