Unlocking the Power of APIs: A Beginner’s Guide

Maleesha Kumarasinghe
2 min readAug 11, 2023

--

What is an API?

An API (Application Programming Interface) is a set of rules and protocols that enable different software applications to communicate and interact with each other, allowing them to share data and functionality in a standardized way.

Imagine this scenario: You are ordering food from a restaurant. First, you place your order via a waiter. The waiter then goes to the kitchen to communicate the client’s order and oversee the preparation process. Once the meal is ready, the kitchen notifies the waiter, who then serves the meal to you.

This scenario illustrates the concept of APIs. In this analogy, your order represents the requested data, and the kitchen can be seen as the database of the application. After processing, the kitchen retrieves the requested data and responds to the application.

For instance, using an API, I can request details about an employee based on their employee ID. The API queries the relevant information from the database and provides it as an employee object.

Why do we use APIs?

The primary goal of using APIs is to centralize our entire business logic within a single application.

What is an API key?

An API key is used to enhance the security of the API. After releasing the application, if someone gains unauthorized access and performs actions such as deleting a user from the database, it poses a significant problem. API keys help mitigate this risk.

What is a REST API?

Process of REST API

A REST API (Representational State Transfer Application Programming Interface) is a type of web API that adheres to a set of architectural principles and constraints. Its purpose is to provide a standardized method for software applications to communicate over the internet. REST APIs rely on the use of HTTP methods (such as GET, POST, PUT, DELETE) to execute operations on resources (data). These APIs use URLs to uniquely identify resources. REST APIs are acclaimed for their simplicity, scalability, and ease of integration.

In summary, while an API is a general concept for enabling communication between software applications, a REST API is a specific implementation of an API that adheres to certain principles, particularly for web-based interactions.

Thank you for reading! Hope this will be helpful for you.

See you in the next article. 👋

--

--