Understanding APIs

What’s an API?
If you’ve interacted with tech/web magazines or blogs, you might at one time have seen the word API and wondered what it means and what its purpose is on the web. API is an acronym that is used in software development to stand for Applic…


This content originally appeared on DEV Community and was authored by Zackius

What’s an API?
If you’ve interacted with tech/web magazines or blogs, you might at one time have seen the word API and wondered what it means and what its purpose is on the web. API is an acronym that is used in software development to stand for Application Programming Interface. An API refers to a set of tasks that provide applications with access to data and allows other applications to interact with other software components.
In simpler terms, an API receives and delivers a user command to a system and sends the response form the system to the user. On your music play app on your phone, when you touch the play button on the screen, APIs receive that command and in turn play the music you want as response.
For an API to be functional there are three things that need to be present and functional.
Application: this refers to a program that is created to perform a certain task other than being compatible with the computer/phone. This can be a media player, a shopping application, or an accounting software.
Programming: this refers to the process of creating an application that carries out a specific task.
Interface: this refers to a distributed boundary across which separate components of an application exchange information. The sharing can be between computer software, hardware or peripheral devices.

API allows developers to make specific calls in order to receive and send data. This transmission is done using a programming language referred to as “JSON”. Javascript Object Notation(JSON) is an independent and lightweight language that is used in sending information between computers. This language can be used to make defined actions like updating, creating, reading and deleting data.
GET: request information(data) from the server.
POST: sends information and changes from clients to the server.
PUT: revise the existing information or add to it.
DELETE: Removes existing information from the server.
Examples of APIs
When you are using an application on your computer or your phone, the application is connected to a server that stores data. In any case, you might be adding, retrieving, updating or deleting data from the application. In a scenario where you are adding, the APIs will receive your data, interpret it to a language that the server can understand then save it. On the other hand, when retrieving data from the server, the server will retrieve the data, APIs interpret it then send it back to the application for viewing in a readable way.

To explain it better, let us take a sociable example.
Imagine yourself sitting in a restaurant, a menu is presented to you to choose what kind of food and drinks to take. After going through the menu and choosing what you would like, the waiter takes your request and passes it to the kitchen department for preparation. After preparing your meal(request) the waiters will bring you the meal.
In our restaurant scenario, the menu represents an interface that we relate to and understand what our server can give us. The waiters represent APIs that receive and deliver requests to our server and to you. The kitchen department here represents the server.

Type of APIs
There are four major types of APIs:
Open APIs: this kind of APIs are also known as Public APIs, this is because they contain no restrictions to access. They can be accessed and used by anyone.
Partner APIs: this type of APIs are not open to the public, to access these APIs a developer requires certain rights or licence in order to work with them.
Internal APIs: Also referred to as Private APIS, this type of APIs are created to be used within a company. Companies use such APIs to improve their services and products.
Composite APIs: This kind of APIs joins different data and service APIs. It uses a sequence of tasks that runs simultaneously as a result of the implementation and not at the appeal of a task. Its major use is in speeding up the process of execution and enhancing the performance of the listeners in the online interface.


This content originally appeared on DEV Community and was authored by Zackius


Print Share Comment Cite Upload Translate Updates
APA

Zackius | Sciencx (2021-11-09T19:42:11+00:00) Understanding APIs. Retrieved from https://www.scien.cx/2021/11/09/understanding-apis/

MLA
" » Understanding APIs." Zackius | Sciencx - Tuesday November 9, 2021, https://www.scien.cx/2021/11/09/understanding-apis/
HARVARD
Zackius | Sciencx Tuesday November 9, 2021 » Understanding APIs., viewed ,<https://www.scien.cx/2021/11/09/understanding-apis/>
VANCOUVER
Zackius | Sciencx - » Understanding APIs. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/09/understanding-apis/
CHICAGO
" » Understanding APIs." Zackius | Sciencx - Accessed . https://www.scien.cx/2021/11/09/understanding-apis/
IEEE
" » Understanding APIs." Zackius | Sciencx [Online]. Available: https://www.scien.cx/2021/11/09/understanding-apis/. [Accessed: ]
rf:citation
» Understanding APIs | Zackius | Sciencx | https://www.scien.cx/2021/11/09/understanding-apis/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.