Throughout my time in numerous computer science classes, API has been a common term that I’ve heard, but I never actually knew what it meant or what it did. I was happy to finally learn about it during class activities and in the introduction of Thea’s Pantry. I found an article by AWS explaining more in depth what APIs are.
What are APIs?
API stands for Application Programming Interface and is a mechanism that enables two software components to communicate with each other using a set of definitions and protocols, similar to the communication between the front end and the back end in Thea’s Pantry. The application sending the request is referred to as the client, and the application responding to the request is the server. In relation to Thea’s Pantry, the front end is the client making calls to the back end, which is the server in this case. Different types of APIs exist such as SOAP, RPC, Websocket, and REST. REST APIs are the most flexible and most popular, and are also the type that we are using in Thea’s Pantry.
REST API
REST APIs are so popular and flexible because the client sends requests to the server as data, and the server uses the client input to start internal functions and send output data back to the client. REST stands for Representational State Transfer and the API uses functions such as GET, PUT, and DELETE in order to access server data. These functions were seen and tested out in recent class activities. The main feature however is statelessness, which means that servers do not save client data between requests. This is a great benefit because it provides scalability, reliability, simplicity and many other key advantages. It is a very good idea to add security to APIs, and REST APIs can be secured by using authorization tokens and API keys.
How to use and API
The first step to using an API is obtaining an API key, which is accomplished by creating a verified account with an API provider. Next, set up an HTTP API client, which will allow you to structure API requests using the API keys. GET, PUT, and DELETE are all HTTP methods for the REST API as seen in class. Even if you do not have an HTTP client, it is still possible to structure requests by yourself in your browser by referring to the documentation of the selected API. And once you understand the API syntax, you are ready to use it on your code.
Source
https://aws.amazon.com/what-is/api
From the blog CS@Worcester – Blog del William by William Cordor and used with permission of the author. All other rights reserved by the author.







