Composite Collection Input
The request body contains an allOrNone flag that specifies how to roll back errors and a compositeRequest collection that includes subrequests to execute.
allOrNone
- Type: Boolean
-
Description: Specifies what to do when an error occurs while processing a
subrequest. If the value is true, the entire composite
request is rolled back.
If the value is false, the remaining subrequests that don’t depend on the failed subrequest are executed. Dependent subrequests aren’t executed.
In either case, the top-level request returns HTTP 200 and includes responses for each subrequest.
- Required or Optional: Optional
compositeRequest
- Type: Composite Subrequest[]
- Description: Collection of subrequests to execute.
- Required or Optional: Required
JSON Example
{
"allOrNone" : true,
"compositeRequest" : [{
Composite Subrequest
},{
Composite Subrequest
},{
Composite Subrequest
}]
}
Composite Subrequest
Contains the resource, method, headers, body, and reference ID for the subrequest.
body
- Type: The type depends on the request specified in the url property.
- Description: The input body for the subrequest.
- Required or Optional: Optional
httpHeaders
- Type: Map<String, String>
-
Description: Request headers and their values to include with the subrequest. You
can include any header supported by the requested resource, except for the following headers
because the subrequests inherit their values from the top-level request.
- Accept
- Authorization
- Content-Type
- Required or Optional: Optional
method
- Type: String
- Description: The method to use with the requested resource. Possible values are POST, PUT, PATCH, GET, and DELETE (case sensitive). For a list of valid methods, see the documentation for the requested resource.
- Required or Optional: Required
referenceId
- Type: String
-
Description: Reference ID that maps to the subrequest’s response and can be used to
reference the response in later subrequests.
You can include the referenceId in either the body or URL of a subrequest. Use this syntax to include a reference: @{referenceId.FieldName}.
The referenceId is case sensitive.
You can use two operators with the reference ID.
The . operator references a field on a JSON object in the response. The [] operator indexes a JSON collection in the response. You can use each operator recursively as long as it makes sense in the context of the response.
- Required or Optional: Required
url
- Type: String
-
Description: The resource to request.
- The URL can include any query string parameters that the subrequest supports. The query string must be URL-encoded.
- The URL must start with /services/data/vXX.X/tooling.
- You can use parameters to filter response bodies.
- Required or Optional: Required