As a developer, there are chances that you must have heard about the word "API" from other devs or somewhere else. What is this "API" they talk about?
Let us start with a basic example
Let's say, as a web developer you build an e-commerce website for a client, and the client later comes back to tell you that he/she needs an app for the website, you hire a mobile developer to build the app.
Take note, the app and the website needs to have same data. If I create an account on the website, I should be able to login my account on the app with the details I created on the website. If I successfully order an item on the website, I should be able to see the item on both the website and the app. That's how it's supposed to work right? cool. So, If I should search for an item on the website and app, data should be the same.
So, basically what is happening here is that immediately the web developer finished building the website, he wrote some codes and set of instructions and sent it to the mobile developer, the mobile developer used it to interact with the website and produced results. So in that way, what ever is done in the app should affect the website.
Let's call the codes and instructions written by the web developer API.
So, if I should try to login with the app, the mobile developer uses the API to check if the login details are correct, if they are correct the app will login, if they are not correct, it throws an error. If I should search the app for items, it uses the API to check if the items are available, if they're available, it displays in the app, if they're not available it doesn't display.
We can notice from here that the app is now controlled by the API right? cool!
So what API does is to allow third party interact with our services. In other words, if you want to interact with a system to retrieve information or perform anything, an API helps you communicate what you want to that system so it can understand and fulfill the request.
What is API?
API stands for "Application Programming Interface" An API is a set of rules that allow programs to talk to each other. The developer creates the API on the server and allows the client to talk to it.
Conclusion
APIs are needed by every BACK-END developer when they want to give their server access to third party. There are different API paradigms which include REST, SOAP and GraphQL. In our next article, we'll discuss about REST. Stay tuned.