💬 Join the DecodeAI WhatsApp Channel for more AI updates → Click here

Mastering APIs: A Simplified Guide for Product Managers (1/3)

Mastering APIs: A Simplified Guide for Product Managers (1/3)

API (Application programming interfaces) is one of the most used words you hear from developers. Whether creating a new product or starting an integration, APIs are everywhere and essential. They are fundamental for modern software development, making new products and integrations possible.

Let’s see what we will learn Today.

  1. What is API? (with example)
  2. Types APIs
  3. Components of API?
  4. Some 'Quick' Important Concepts

What is API?

Imagine you’re at a restaurant. You, the customer (user/client), tell the waiter (the API) what you’d like to eat. The waiter takes your order and communicates it to the kitchen staff (API server) in a language they understand, perhaps using special codes or shorthand. The kitchen staff then prepares the food based on your order and hands it back to the waiter. Finally, the waiter delivers your delicious meal (data) to you. This is a simple analogy from postman.com

Source: postman.com

Similarly, when you use an application, you’re like the customer placing an order (making a request). The API acts like the waiter, facilitating the process by getting what you requested from another part of the system (the API server) and bringing it back to you. This smooth, behind-the-scenes process ensures you get what you want efficiently.

2 (a): Types of APIs (categorized by access):

  • Private APIs: These are like secret passages within a company's digital world. They help different parts of the company share information securely. For example, a private API might let the HR system talk to the payroll system, but it's not open to people outside the company.
  • Public APIs: These are like windows that companies open to let others peek inside their systems. Developers from outside the company can access these windows to use the company's services or data. Some APIs are free, while others require payment. For instance, a weather company might provide a public API for accessing weather data in apps or websites, either for free or with a subscription fee.
  • Partner APIs: Used for collaboration between companies, accessible only to authorized partners with proper authentication.

2 (b): Types of APIs (architectural style)

  1. REST ( Representational State Transfer):

    REST is the most popular API architecture for transferring data over the internet. When you use a REST API, you follow certain rules and use methods to interact with the data. Each piece of data has its own address (URL). You can access these data addresses, called endpoints (will explain this later) , to do things like get, create, update, or delete data using the appropriate method.

    There are five main methods used in a REST API:

GET — retrieves a specific resource or collection of resources

POST — creates a new resource

PUT — updates an existing resource

DELETE — removes a specific resource

PATCH — partially updates an existing resource

Imagine you're ordering food online. When you browse the menu and select items for your order, the website sends a request to the restaurant's computer system to check if those items are available. The restaurant's system then sends a response back to the website with the available items and their details, and you can proceed to place your order. This interaction between the website and the restaurant's system is facilitated by a REST API.




2. SOAP: This stands for Simple Object Access Protocol, uses XML to transfer highly structured messages between a client and server. SOAP is often used in enterprise environments or legacy systems, and while it includes advanced security features, it can be slower than other API architectures.

3. GraphQL: GraphQL is an open-source query language that lets clients get exactly the data they need from a single API endpoint, without making multiple requests. This reduces the number of trips between the client and server, making it ideal for applications on slow or unreliable networks.

4. gRPC: gRPC, created by Google, stands for Remote Procedure Call. It allows a client to call functions on a server as if they were on the same machine. This makes it easier for different parts of a distributed system to communicate with each other efficiently.

Fact: Before REST, developers used SOAP, which was really complicated. In 2000, Roy Fielding and a group made REST, which made APIs much easier to use. It quickly became popular, and by the mid-2000s, many platforms were using it. Now, RESTful APIs are the norm, and tools like Postman help developers work with them easily.



Story continues...

💬 Join the DecodeAI WhatsApp Channel
Get AI guides, bite-sized tips & weekly updates delivered where it’s easiest – WhatsApp.
👉 Join Now