What Is Application Programming Interface (API)
Published: 2022-05-07 17:36:30

What Is Application Programming Interface (API)
Let’s start with a real-life example that helps us understand API’s fundamentals. Suppose you are going to a restaurant and you have to order some food, what procedure do you follow, you have to look at the menu and select the food item you want to have for dinner. Here the menu is acting as an API you are selecting different food items from the menu which are not prepared by you, which means you are using items made by others.
        					I think you are ready to walk through the leman example to the technical definition of application programming interface (API).
An application programming interface (API) is a connection between a computer or between computer programs. It is a type of software interface, that offers a service to other pieces of software. An API specification is a document or standard that describes how to build or use such a connection or interface. A computer system that meets this standard is said to implement or expose an API. The term API may refer either to the specification or to the implementation.
How an API works
An API is a set of defined rules that explain how computers or applications communicate with one another. APIs sits between an application and the webserver, 
Here’s how an API works:
1.	A client application initiates an API call to retrieve information—also known as acting as an intermediary layer that processes data transfer between systems. as a request. This request is processed from an application to the web server via the API’s Uniform Resource Identifier (URI) and includes a request verb, headers, and sometimes, a request body.
2.	After receiving a valid request, the API makes a call to the external program or web server.
3.	The server sends a response to the API with the requested information.
4.	The API transfers the data to the initial requesting application.
APIs offer security by design because their position as middlemen facilitates the abstraction of functionality between two systems—the API endpoint decouples the consuming application from the infrastructure providing the service. API calls usually include authorization credentials to reduce the risk of attacks on the server, and an API gateway can limit access to minimize security threats. Also, during the exchange, HTTP headers, cookies, or query string parameters provide additional security layers to the data.
 Types of APIs
Nowadays, most application programming interfaces are web APIs that expose an application's data and functionality over the internet. Here are the four main types of web API:
•	Open APIs are open-source application programming interfaces you can access with the HTTP protocol. Also known as public APIs, they have defined API endpoints and request and response formats.
•	Partner APIs are application programming interfaces exposed to or by strategic business partners. Typically, developers can access these APIs in self-service mode through a public API developer portal. Still, they will need to complete an onboarding process and get login credentials to access partner APIs.
•	Internal APIs are application programming interfaces that remain hidden from external users. These private APIs aren't available for users outside of the company and are instead intended to improve productivity and communication across different internal development teams.
•	Composite APIs combine multiple data or service APIs. These services allow developers to access several endpoints in a single call. Composite APIs are useful in microservices architecture where performing a single task may require information from several sources.


Types of API protocols
As the use of web APIs has increased, certain protocols have been developed to provide users with a set of defined rules that specifies the accepted data types and commands. In effect, these API protocols facilitate standardized information exchange:
•	SOAP (Simple Object Access Protocol) is an API protocol built with XML, enabling users to send and receive data through SMTP and HTTP. With SOAP APIs, it is easier to share information between apps or software components that are running in different environments or written in different languages.
•	XML-RPC is a protocol that relies on a specific format of XML to transfer data, whereas SOAP uses a proprietary XML format. XML-RPC is older than SOAP, but much simpler, and relatively lightweight in that it uses minimum bandwidth.
•	JSON-RPC is a protocol similar to XML-RPC, as they are both remote procedure calls (RPCs), but this one uses JSON instead of XML format to transfer data. Both protocols are simple. While calls may contain multiple parameters, they only expect one result.
•	REST (Representational State Transfer) is a set of web API architecture principles, which means there are no official standards (unlike those with a protocol). To be a REST API (also known as a RESTful API), the interface must adhere to certain architectural constraints. It’s possible to build RESTful APIs with SOAP protocols, but the two standards are usually viewed as competing specifications.
Common API examples
Because APIs allow companies to open up access to their resources while maintaining security and control, they have become a valuable aspect of modern business. Here are some popular examples of application programming interfaces you may encounter:
•	Universal logins: A popular API example is a function that enables people to log in to websites by using their Facebook, Twitter, or Google profile login details. This convenient feature allows any website to leverage an API from one of the more popular services to quickly authenticate the user, saving them the time and hassle of setting up a new profile for every website service or new membership.
•	Third-party payment processing: For example, the now-ubiquitous "Pay with PayPal" function you see on eCommerce websites works through an API. This allows people to pay for products online without exposing any sensitive data or granting access to unauthorized individuals. 
•	Google Maps: One of the most common examples of a good API is the Google Maps service. In addition to the core APIs that display static or interactive maps, the app utilizes other APIs and features to provide users with directions or points of interest. Through geolocation and multiple data layers, you can communicate with the Maps API when plotting travel routes or tracking items on the move, such as a delivery vehicle.
•	Twitter: Each Tweet contains descriptive core attributes, including an author, a unique ID, a message, a timestamp when it was posted, and geolocation metadata. Twitter makes public Tweets and replies available to developers and allows developers to post Tweets via the company's API.
ABOUT POSTMAN:
Postman started simply as a side project to solve a specific problem: Abhinav Asthana, Postman's CEO and co-founder, set out to create a tool that would simplify the API testing process. As the tool's usage quickly exploded, Abhinav recruited two of his former colleagues, Ankit Sobti and Abhijit Kane, to help him create Postman, Inc. Postman is now the world's leading API platform, and the three founders still lead the company to this day.
Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
It’s a very useful platform for students and working professionals and it helps me a lot while learning the concept of API, I have great experience learning and testing API using the postman tool.
That’s all from my side I hope this helps you an understanding concept of API’s.