Salesforce Composite resources
Use REST API composite resources are helpful to improve application’s performance by minimizing the number of round-trips between the client and server.
All the series of rest apis are counted as a single call towards your API limits. This is executed in the context of the same user.
Series of REST API requests in a single call.
Multiple CRUD Operations
Output of one request as the input to a subsequent request.
Response bodies and status in a single response body.
Counts as a single call toward your API limits.
Executed in the context of the same user.
Composite request body
Here you are seeing an example of a composite request body
{
"allOrNone" : true,
"collateSubrequests": true,
"compositeRequest" : [
{ Composite Subrequest},
{ Composite Subrequest},
{ Composite Subrequest}
]
}
Composite request response
{
"compositeResponse" : [
{ Composite Subrequest Result },
{ Composite Subrequest Result },
{ Composite Subrequest Result }
]
}
Type of Composite Resources
There are different composite resources available
Composite API
Batch
SObject Tree
SObject Collection
Grapths