,

Salesforce Composite API

swagataray Avatar

A Salesforce composite API, in the context of software development and web services, is an API (Application Programming Interface) that aggregates and orchestrates multiple individual APIs and services into a single, unified interface. The goal of a composite API is to simplify and streamline the interaction with multiple underlying APIs by providing a higher-level interface that combines the functionality of various services.

Blog on the Composite Graph API

Blog on the Composite Tree API

Key characteristics of composite API

  1. Aggregation: Salesforce Composite APIs aggregate services from different sources or endpoints. They can pull information from multiple APIs and present it as a single resource or response. So in a single API call, you can find the data from Account as well as from related Contacts.
  2. Orchestration: These APIs often involve complex workflows and logic to coordinate requests and responses from the underlying APIs. They might involve conditional branching, data transformation, and other forms of orchestration to achieve a specific task or objective. If you want to find a Account using an external field and then use that Account to create a contact, it’s all possible!
  3. Simplification: The primary purpose of Salesforce composite APIs is to simplify the interaction with a set of APIs. Instead of developers having to make multiple requests and handle complex coordination themselves, they can make a single request to the composite API, which takes care of the underlying complexity. If you want to create Account, Person Name, Person Language, Contact Point Phone and Contact Point Consent in a single go, Composite API is your choice.
  4. Security and Authentication: Salesforce Composite APIs often handle authentication and authorization for the underlying APIs, ensuring that users and applications have the appropriate permissions to access the combined resources. You no need do separate authentication for all the internal APIs. It is taken care by the composite API itself.

Salesforce Composite APIs are particularly useful in scenarios where applications need to interact with multiple services or data sources to fulfill a specific task. They are commonly used in micro services architectures, where different micro services offer specific functionalities, and a composite API combines these micro services to provide a higher-level service to clients.

Overall, composite APIs help developers build more efficient, scalable, and user-friendly applications by simplifying the complexity of working with multiple APIs and services.

Note: All subsequent API transactions under a wrapper Composite API treated as single API consumption . So, this is also a good point to start using composite API.

Overview of the Salesforce Composite API

There are four types of flavor in the Salesforce Composite API

  1. Tree
  2. Batch
  3. Sobjects
  4. Graph

URI of the Composite API

https://MyDomainName.my.salesforce.com/services/data/v59.0/composite/

Sub domains are

Graph

https://MyDomainName.my.salesforce.com/services/data/v59.0/composite/graph

Batch

https://MyDomainName.my.salesforce.com/services/data/v59.0/composite/batch

Sobjects

https://MyDomainName.my.salesforce.com/services/data/v59.0/composite/sobjects

Tree

https://MyDomainName.my.salesforce.com/services/data/v59.0/composite/tree

In my next Blog, I will start writing about each section of the Composite API and my first choice is Graph API.

Resources

Salesforce Composite API Developer’s guide

swagataray Avatar

One response to “Salesforce Composite API”

  1. […] Salesforce Graph API aka Salesforce Composite Graph API is a part of the bigger API umbrella called Salesforce composite Graph API. This Graph API is very powerful API which can be utilized for API aggregation, orchestration etc. I will discuss these further but if you want to learn about Composite API, then click here […]

Leave a Reply

Related articles

Discover more from Tech Talk

Subscribe now to keep reading and get access to the full archive.

Continue reading