API

04/07/2021

What is an API (Application Programming Interface)?

API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.

What Is an Example of an API?

When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API.

To explain this better, let us take a familiar example.

Imagine you’re sitting at a table in a restaurant with a menu of choices to order from. The kitchen is the part of the “system” that will prepare your order. What is missing is the critical link to communicate your order to the kitchen and deliver your food back to your table. That’s where the waiter or API comes in. The waiter is the messenger – or API – that takes your request or order and tells the kitchen – the system – what to do. Then the waiter delivers the response back to you; in this case, it is the food.

Here is a real-life API example. You may be familiar with the process of tracking your orders online. For example, your courier's name is Giao Hang Tiet Kiem and your tracking order code is ABCDE123456. In order to track your order, you have to interact with the courier’s website to access their database and see the status of your order.

However, what if you are not using the courier’s website––a channel that has direct access to the information? What if you are using your own website, such as the one that you've created with Piggolo Web Platform?

Your website, in this case, interacts with the courier’s API. The API is the interface that, like your helpful waiter, can be asked by that online courier service to get information from the courier’s database to track order status, post a new order, or cancel a previous one. The API then takes the courier’s response to your request and delivers it right back to your Piggolo server, which then shows you the most updated, relevant information.

What an API Also Provides Is a Layer of Security

Your phone’s data is never fully exposed to the server, and likewise the server is never fully exposed to your phone. Instead, each communicates with small packets of data, sharing only that which is necessary—like ordering takeout. You tell the restaurant what you would like to eat, they tell you what they need in return and then, in the end, you get your meal.

APIs have become so valuable that they comprise a large part of many business’ revenue. Almost all major companies like Google, Facebook, Amazon, GHTK, etc. are using APIs to manage connections with partner servers such as this one at Piggolo.

The Modern API

Over the years, what an “API” is has often described any sort of generic connectivity interface to an application. More recently, however, the modern API has taken on some characteristics that make them extraordinarily valuable and useful:

Modern APIs adhere to standards (typically HTTP and REST), that are developer-friendly, easily accessible and understood broadly