Let’s consider some real time scenarios first.
You go to any restaurant for a grand party. A waiter comes to your desk and takes your order. Waiter goes to kitchen and brings up your ordered food. You don’t bother how waiter did this. You just worried about your order. In more specific way, You are concerned for your work to be done not how it is done and by whom it will be done.
Let’s see an another example. You launch Facebook URL on a browser and enter your credentials. If you provide correct credentials, you should view home page of your account. If you provide wrong credentials, you will see some error message. How it happens actually? When we pass credentials, some information is being sent to Facebook’s back end through messenger. These credentials information is validated and response is sent back to end user through messenger.
Let’s see an another example. You wanted to book a flight ticket. You generally use a website which shows flights from all flight service provider. E.g. Yatra. When you enter all required details like Source, Destination, Journey date etc and click on search, you can see N number of flights from different airlines. Actually when you provide all details, Yatra sent a message through messenger to all airlines and request flight information as per requirement. Airlines returns list of flight with price to Yatra and it shows up to end user.
In all above example, you could notice one common thing: “Messenger”. This messenger in technical world is called as an Application Programming Interface (API). An API performs what user has requested without exposing internal logic or working of task done. You are able to login to Facebook and use it but you don’t get to know how Facebook is working internally. You can also think API as an example of oops concepts called Abstraction.
In terms of software we can define API as below:
“An API is a set of codes which allows two or more than two applications to communicate each other internally or externally and provide a result to end users or to another API.”.
An API can call another API or Output of an API can be input for another API.
If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.