Inserting data in batch
For cloud customers on Azure, it is possible to insert and update data in bulk with the REST API. A specific BATCH endpoint is available to support these requests.
BATCH operations
With the batch operation, it is possible for API clients to perform multiple actions, like inserts and updates, for multiple resources within a single request.
Batch size
Batch API use is subject to the standard API usage limits. Each HTTP request counts as one call when calculating usage limits. Next to that, a batch can contain a maximum of 100 records per request.
Headers
The main request headers are applied for all the requests from the batch action. It is not possible to set the headers for each individual request.
Request body
A JSON batch request body consists of a single JSON object that MUST contain the name/value pair requests.
The value of requests is an array of request objects, each representing an individual request. All requests which have no atomicity group set will be processed in separate transactions. Note: an individual request MUST NOT itself be a batch request.
A request object MUST contain the name/value pairs id, method, and url, and it MAY contain the name/value pairs atomicityGroup, dependsOn, and body. The table below explains more about these name/value pairs.
id
The value of this property is a string containing the request identifier of the individual request. It allows only alphanumerical, dashes, dot, and underscore characters.
It MUST NOT be identical to the value of any other request identifier nor any atomicityGroup within the batch request.
method
The value of this property is a string that MUST contain one of the literals DELETE, PATCH, POST, or PUT. These literals are case-insensitive.
url
The value of this property is a string containing the individual request URL. The URL MUST be an absolute path which is appended to scheme, host, and port of the batch request URL. It should not start with a slash.
Note: only Object is supported, it is not possible to execute multiple REST workflows in batch.
body
The value of this property can be null, which is equivalent to not specifying the body name/value pair.
atomicityGroup
The value of this property is a string whose content MUST NOT be identical to any value of id within the batch request. It allows only alphanumerical, dashes, dot, and underscore characters.
All request objects with the same value for atomicityGroup MUST be adjacent in the requests array.
These requests are processed as an atomic operation and in a SINGLE transaction and MUST either all succeed, or all fail. If one of the requests fails, then all the other requests from that atomicity group will have a response with status code 424 - Failed Dependency.
dependsOn
The value of this property is an array of strings whose values MUST be id-values of preceding request objects; forward references are not allowed.
dependsOn property can be used only for requests without an atomicity group or for requests with the same atomicity group.
It is possible to reference the request which it depends on to get the correct entity and identifier combination. The syntax for this is $[dependsOn_id].
If one of the requests it depends on has failed, the dependent request is not executed and a response with status code of 424 - Failed Dependency is returned for it as part of the batch response.
Example of a BATCH request
POST https://customer.ultimo.net/api/v1/batch
Example of a BATCH response
Example of a BATCH request with atomicityGroup and dependsOn
POST https://customer.ultimo.net/api/v1/batch
Example of a BATCH response with atomicityGroup and dependsOn
Last updated