WHAT IS AN API AND HOW DOES IT WORK
How do apps let you create an account and log in with your Facebook or Google credentials? Or how does your favorite weather app gets today weather forecast? The answer to both these questions is that they talk to other system to get the data or to verify your credentials and the way that this two systems talk is through something called an API the word Application Programming Interface.
An API simply states the rules for the communication to happen, for example if you are apTechnologuplying for a passport, you cannot just go the printing facilities and make yourself a passport, there are some certain procedures you have to follow, like you fill out the forms, you take a photo, you take the documents to the passport and you talk to the attendant and hand in your documents, you pay the fee and then you wait, you have no idea what is happening behind the scenes once you hand in your documents. The system took your inputs, it is working in the back and when it is ready it will produce your passport and give it to you, this is exactly like how an API works.
The passport production process is the system that we want to communicate with because we can’t access the internals of the system, we can only talk to the API layer which in this case is the attendant at the passport office, this is known as an End Point which just mean that the attendant is a point of contact for us to submit our inputs. With each End point there is a protocol about what inputs are required and what results you will get in return, if you don’t submit the correct inputs then your request will get rejected.
Normally, you also have to submit and API key with your request which is just a unique ID to identify your app. This way, this is the passing record of who is accessing its End point. Imagine that different system will each have their own API with different End points and protocols for each End point about what inputs are required, your app can communicate and interact with all of these different systems through their respective API’s, luckily all API’s will have some sort of documentations describing how to communicate with the End points. And some systems won’t have an API so you won’t be able to talk to that system at all.