Salesforce Composite API

 Composite API : API that is built by combining existing API functions. A single request to an API can perform multiple functions.

Responses from one API method can be directed as inputs to another method. For example use id of account created and use it in creating a contact.

Multiple API's can be used in a single call to improve performance.

1] Batching REST resource : allows for sending multiple REST calls in a single roundtrip. These calls are unrelated and executed serially on SF side.

2] TreeSave REST resource : allows creation of multiple records in a single call.

3] Apex REST : can be used to build custom logic.

Composite API creates/updates/upsert/deletes


Request consists of two attributes

1] allornone

2] compositeRequest : an array of individual REST request (compositeSubrequests).

Each compositeSubrequests consists of following attributes


Example:


Here is the composite result



Setup VSCode with Salesforce

Step by Step guide to setup VSCode with Salesforce Install vscode Install Salesforce CLI (developer.salesforce.com/tools/sfdxcli) Perform fo...