Clone a branch
This method clones a branch. If the origin branch has 1000 segments, the system will create identical clones of all those segments and assign them to the new branch.
URL
(POST) /api/apps/wbflex/documents/{id}/branches/clone
PARAMETERS
The URL parameters are:
id | Specify the Flex container ID | string, Mandatory |
The BODY must be a JSON object with these properties:
branch | The branch of the segments. | string, Mandatory |
branchNew | The name of the new branch. | string, Mandatory |
callback | Specify a URL which will be called upon success or failure of operation. This makes polling for operation status unnecessary. See Callbacks (with asynchronous operations) | object, Optional |
RESULTS
The operation is asynchronous and may take a few seconds to complete. The method returns an Asynchronous operation result:
{
"trm": {
"requestid":32230,
"status":"Waiting",
"statusText":"Waiting..."
}
}
Specify the callback in the payload to be automatically notified of completion. Otherwise you need to poll the operation for completion (until status = “Finished”). When finished (or via the callback) you obtain the results as a JSON:
{
"trm": { ... }
"custom": {
"segments": 5690,
"error": null
}
}
The result provides an indication of how many segments were updated by the script.
segments
: Total segments cloned into the new branch.error
: A message if the clone fails. For example, if the new branch already exists, or the source branch has no segments.