Web applications these days are developed as single applications on the front side connected to the backside through API which are written in different languages. Therefore rest APIs are the backbone of web development. APIs serve as the intermediary between the front end and the backend.
What is an API
API is a short form for Application Programming Interface which is an intermediary which allows two applications to communicate with each other, for example, any time you are using an app on your phone, for example, Facebook to send an instant message to another user or posting into your wall, you are using an API.
APIs are not exposed to users so that they can see them but they are the driving factor that allows action or functions to be fulfilled in a web application or an Android application
How do APIs work
Like we have explained above API sends instructions from front end applications where then the backend application interprets the data they have received and perform according to what they have been programmed and return data in a readable way where then the front end application displays the results to the user in a way he can understand
A real-life example of how APIs work
Suppose you are in a restaurant with a menu that has multiple choices items you can choose from, then there is the kitchen staff who are to prepare what you have ordered, the kitchen, in this case, acts as the backend system, so what is missing is how your order is going to reach the 'system' ie the kitchen and then you get your favourite meal.
The linking that is missing in this process is how your order it's going to reach the kitchen and that's now when an API comes in, it provides the link between you and the kitchen and in this scenario, the API is the waiter who collects your order and sends it to the kitchen to have it prepared and then bring it to your table.
Are APIS important?
'Josh Walker describes building an application without APIs as basically building a house with no doors'
- APIS Provide a layer of security
Before I came in contact with APIs I could do the direct interaction between the front end application and the database by having the code or instructions to add to the database for example, in the same file which could not provide security to my database since anyone who could in any case come across the file could get everything of how the application is implemented.
With the use of APIs the front end file and the back end file which consists of the instructions to interact with the database are separately placed and to interact with these files some conditions must be met, for example, a security key is usually used so that It can confirm if it is the actual person performing the action is authenticated and is not an intruder who may have intentions of stealing data or harming the system
- APIS helps you interact with a system you did not develop
For example, Google has developed multiple Solutions Eg Google Maps, Google Analytics and many more. They build these Solutions and allowed users all over the world to interact with them. This means you can configure your system to use Google Maps, good examples are Uber and bolt taxi systems, they use Google products to run the daily business errands. This is made possible by the APIs developed by Google.
This shows how important APIs are since without them bolt and Uber would have started the process of building their own map system which would have delayed their operations.
API is our backbone as developers while developing solutions since it facilitates growth and allows scaling of the product
This is the introduction to APIs and we will highlight how to write and use them in our next articles