Lets learn something new today: API basics
All product managers needs to learn the technical basics of what they are working with and this article will provide the foundations! Consider this part 1 to learning APIs :)
Think back when you were 10 years old.
You are hungry and want to eat a cookie, which is stored in one of the top shelves in the Kitchen. However you are not tall enough to reach there.
So what would you do? You would say that you are hungry to your parents and that you want to eat a cookie, and they will help us in picking it up!
This is a simple explanation of what an API is.
What parents does to you in this example is exactly what an API (Application Programming Interface) does to softwares. They act as software intermediaries and allows two applications to talk to eachother.
Suppose you are a financial software provider company, and have developed an extensive banking software to manage, for example, the Regulation Compliance vertical for any bank.
However each and every bank would have their own interface developed over the years, so they simply won’t switch to the UI/UX that we as a company have developed. So to still manage the Regulation Compliance vertical for the bank with the existing UI/UX, they would need some means to connect their software with ours. Here we use APIs.
How does it work?
There are 4 main components that ensures the complete working of an API. They are:
#1 API Client
They are responsible for putting together all the pieces required for an API processing and triggers the API request to the API server. They also handle the data that is returned by the API server, and displays it in a more user readable format! Postman app is an example of a API Client.
#2 API Request
An API Request is a request sent to the Applicable Programming Interface to process and receive the data. It consists of:
Endpoint: Every API request is directed to an endpoint, which is nothing but an URL which provides access to a specific resource. For a financial software application example, an application fetching the transaction list would be a resource that the endpoint directs to.
Method: REST APIs are accessible through standard HTTP methods, such as GET, POST, PUT, PATCH, and DELETE, which facilitate common actions like retrieving, creating, updating, or deleting data. This defines the operation that the API Client should do on the selected resource.
Parameters: These are variables that are passed on the endpoint URL. For example, a customer id would be a parameter for a financial software API to return records pertaining to that particular customer.
Request headers: This provides additional information about the request. Suppose you need to find the transaction history for a particular date range, then the ‘from date’ and the ‘to date’ would be populated under the request headers.
Request body: This contains the actual information that is required to create, update, or delete a record that is created in the system. It is usually in the JSON or XML format.
#3 API Server
The API server is responsible for handling authentication, validating input data, retrieving or manipulating data from a database, and returning the appropriate response to the client.
However the database is not part of the API server, however the entire functioning cannot be done without it as well, because the database stores and organizes this data in a way that facilitates efficient retrieval and manipulation.
The API server therefore acts as an intermediary between the API client and the database.
Before the data even reaches the API server, it can also be redirected to third-party applications or other authentication servers to ensure more flexibility and security with the system.
#4 API Response
The two things that are highlighted in above image. One is called as the response body, and the other is called as the API status code. These status codes gives us information about the API request that is processed and received by the API client. Some of the most common API status codes are 200 OK, 400 Bad Request, 404 Not Found, etc.
The response body gives us more information about the data returned by the API server. We usually get a JSON or XML representation of the API response.
Real world example
Lets look at a Financial services company example - Temenos
Temenos' open APIs allow you to integrate quickly with a wide range of internal or external systems to help drive your product and service innovation.
They have many APIs that look at the consent management, account management, transaction details, transaction history, GDPR request, data protection APIs, and many many more.
The API led design of Transact allows banks to deploy the product independently of the front office. APIs make it easier to integrate Transact with the bank's wider ecosystem, including third-party providers, and even extend and modify the behavior of its banking capability. The introduction of open APIs, covering every aspect of core banking, together with a dedicated API Developer portal, helps banks maximize Fintech innovations and tailor their products to customer needs.
Similarly many other organizations also use APIs to improve their operational efficiency and enhance their business flows!