Run APIs in Batches
post
/api/core/Batch/execute
Runs the batch of APIs specified in the body as elements in an array. At minimum, each Action element requires the api and method property. Additional required properties change depending on the specified endpoint and method.
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
Show Source
object
-
Actions: array
Actions
The array of objects with API requests defined in them.
Nested Schema : Actions
Type:
array
The array of objects with API requests defined in them.
Show Source
Nested Schema : items
Type:
Show Source
object
-
api: string
The API endpoint to run a request against.Example:
broker/services
-
data: object
data
The request body for the API.
-
dynamicData: object
dynamicData
Key-value pairs. Values change dynamically as the batch file is run.
-
forEach: object
forEach
An object defining a loop over an array. The API is called for each item in the array.
-
method: string
The method of the API to call.Example:
read
-
response: array
response
The array of field-value pairs to populate with values from the API response.
Nested Schema : data
Type:
object
The request body for the API.
Example:
{
"ExampleKey":"ExampleValue"
}
Nested Schema : dynamicData
Type:
object
Key-value pairs. Values change dynamically as the batch file is run.
Example:
{
"ExampleKey":"ExampleValue"
}
Nested Schema : forEach
Type:
object
An object defining a loop over an array. The API is called for each item in the array.
Example:
{
"from":"jobIDs",
"varName":"jobID"
}
Nested Schema : response
Type:
array
The array of field-value pairs to populate with values from the API response.
Show Source
Example:
[
{
"varName":"serverID",
"fieldName":"ServerID"
}
]
Response
Supported Media Types
- application/json
200 Response
Successful operation
Root Schema : schema
Match All
Show Source
-
object
SuccessfulGetOperation
The response body for a successful get operation.
-
object
type
Nested Schema : SuccessfulGetOperation
Type:
object
The response body for a successful get operation.
Show Source
-
message: string
The response message.Example:
Loaded 1 entries
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
true
Nested Schema : coreBatchExecuteResponseBody
Type:
Show Source
object
-
api: string
The API endpoint from which the response is returned.Example:
/broker/services
-
method: string
The method of the API that was called.Example:
read
-
request: object
request
A combined object with properties of both data and dynamicData from the request body.
-
response: object
response
The response object from the API.
Nested Schema : request
Type:
object
A combined object with properties of both data and dynamicData from the request body.
Example:
{
"fromData":"value1",
"fromDynamicData":"value2"
}
Nested Schema : response
Type:
object
The response object from the API.
Example:
{
"success":true,
"message":"example",
"data":[
]
}
Default Response
Failed operation
Root Schema : schema
Type:
Show Source
object
-
errors: array
errors
The list of errors reported. Validation errors will be keyed by record field.
-
message: string
The response message.Example:
Exception thrown
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
false
Nested Schema : errors
Type:
array
The list of errors reported. Validation errors will be keyed by record field.
Show Source
-
Array of:
object items
An error.
Nested Schema : items
Type:
object
An error.