What is API?
How does it interact with a database and worth knowing backend terminology.
Formally, API means Application Programming Interface. In our words, an API is the part of a system that has been “stored” in a server (cloud nowadays) that receives requests and send responses from and to other systems or frontend sides.
When an API receives or sends data to other system, it is interacting with a 3rd party software. That interaction receives the name of “integration”. Whenever you see that you can “integrate” your software, it means there’s another software ready to provide yours with more data or services. This is used to extend software features avoiding the re-implementation of features that are already developed and work correctly. Just like in life itself, in software nobody works in re-inventing the wheel neither.
A good example for integrations are payment methods, for instance Webpay, Paypal, Google Wallet, Apple pay, Braintree, among other services are already providing secure mechanisms to manipulate credit cards information and online payments. If you are developing an app to sell products in your city, you don’t need to worry about the payment feature anymore. Instead, you integrate your app with one or more of these payment methods and you are ready to charge for your products providing secure payments! As a result, your app becomes a small e-commerce developed with minimum effort :).
You have been using integrations more times than what you can imagine. When a website offers the option of creating a new account or to login with facebook or google, it is offering a login integration! Facebook and Google provide APIs for developers to use their login services in their webs or apps.
APIs also provide our webs or apps with information, such as receiving our friend’s posts in our facebook walls. All those posts are stored in a database but Facebook app does not access to that database directly, mainly because of security reasons. It accesses its database through the Facebook API, which is part of the backend code developed. So, what backend developers do is creating and maintaining APIs, integrating software with 3rd party systems and creating and maintaining databases.
Take a look at the following image, APIs are stored in servers, typically in the cloud nowadays, AWS, Google Cloud or MS Azure. Also the databases are stored there. In general words, APIs are then an intermediate in between different systems or in between frontend or mobile app and the data base where the app or web consumes the information to be displayed in the user interface ( what you see in the screen).
APIs receive a message from Facebook login “hey, log in the user John1 with password 123456” and it accesses the data base to verify if there’s a user with that username and that password. If the database finds a match, API responds to the login screen with an “OK” message and the login screen knows it has permission to show the next screen: your facebook wall. Otherwise, the login screen knows it should display an error message.
In this image we also see a set of tables displaying different information. A set of tables and relationships between them has a name: database! As you see, there is a table for users, where the API verifies if the username and password received belong to a real user of the system. Then, there is a table for the user’s profile and another one for every user’s friends. All the tables have a column called “id”. All the elements with id 1 belong to user John1. That column defines the relationship between all the tables.
Databases are used to store information and provide data persistency, which is the action or preserving data permanently (to store it) but also the action of accessing that data to read and use it.
This is how the software we use access to our data, but you may still wonder how the Facebook login from the example knows where to look for its API. This is the secret: the login screen, also called “frontend” side of the Facebook website or “mobile” if you access from a smartphone, has in its code the URL address where it will send the login data to be validated. I don’t really know how the login endpoint looks like, because it is private, but the developers website shows some others. Login would not be very different from obtaining a certain post from a certain user, which looks like this
https://www.facebook.com/{username}/posts/{post-id}
The developer should create a mechanism to transform {username} into the real user name, like John1 in our example, and {post-id} into a post id number. With both elements, you can access the post. Following this logic, a potential Facebook login URL could be:
https://www.facebook.com/login/{username}/{password}
When the URL are accessible from an API, they receive the name of endpoint. whenever you hear developers saying things like “hey, backend guy, what’s the endpoint for the login?” you know what they are talking about ;)
Working in sales or even in human resources in an innovation lab or IT company can sometimes be challenging. A big percentage of the people we talk to have a technical background, and if we are engaged in recruitment or generating trust in a potential new customer, it is recommended to have at least the basic knowledge of software definitions. With the right tools, we can understand other people better and explain ourselves better.
If you work in sales, I promise your trust generation ability will be increased with your technical communication skills, meaning that you will reach more sales and provide a better customer experience.
If you work in HR, you will develop more empathy with developers and engineers, you will be accepted in their circle, they will feel more open to talk to you and you will be able to have clear insights about what they feel at work. They will give you the best feedback for you to work in innovative solutions for a better working environment and talent management. If you give them trust, understanding and space to share, they will give you great ideas to implement and grow the company from its core: the teams.
Remember you can leave your messages, comments and suggestions in the comment section below. Clap if this post was useful to you and share it. Knowledge is nothing if we just keep it for ourselves,