A Composite API executes a series of REST API requests in a single call. The output of the initial request can be used with the input to a subsequent request.
A Composite API is like a waiter taking multiple orders at once.
Imagine you are in a restaurant and a waiter comes to take your order. You are sitting all the way at the end of the restaurant in a single row of tables. Instead of taking your order, then going straight back to the kitchen to deliver the order to the Chef, it is more efficient for the waiter to take the order of each table on their way over to the Chef.
Starting with you, the waiter will stop at each table and take each order on their way back to the kitchen. Once the waiter has reached the kitchen, they will give the Chef all of the orders.
A Composite API lets you perform multiple actions that are then communicated in a single act.
It's one thing to know what a term means, but that is worthless if you don't know why you should know what a composite API is in the first place. Let's break down the importance of this tech term based on two high level categories. We'll walk through an explanation as well as provide a score, 1-10, that shows you how much you should care about composite APIs.
The first will be if you do not have a product yet. This means that you don't have a physical product. Maybe you're in the ideation phase, or maybe you're almost ready to start development. Whichever it is, we'll get into why a composite API is important and why you should or shouldn't care about it if you do not have a product.
As a founder, a Composite API is not too relevant if you don’t have a product yet. You should learn about the functionality of an API, but the actual type of APIs is more relevant once you actually have a product and need to understand how your site should function most effectively.
The second category is if you do have a live product. Maybe you just launched your business or maybe it's been live for years and you're continuing to improve its quality. Regardless of the scenario, if your product is live, a composite API carries a different weight.
As a founder, a Composite API is not too relevant unless you want to have a deeper understanding of how your developers are most efficiently working with your APIs. You should at minimum, have an understanding, of the type of APIs that are being used, but the actual technical details of how it works is more on the shoulders of your developers.
So you know what a composite API is, by definition. You know if you should care about it or not depending on your situation as a business/company/product. To dig in deeper, we will walk through some examples so we can make sure you really have a solid grasp on composite APIs.
First thing to note is that a composite API is different than a batch API in that a composite API executes a sequence of API calls whereas a batch API executes a lump of API calls at once. Let's walk through some examples of composite APIs.