Hello developers! In this post, we’ll discuss various methods to request an API for your next project.
In the chapter 1 of this post, we’ll discuss what APIs means, it’s categories and types.
Then in the chapter 2, we’ll discuss various methods in making API calls with JavaScript.
- WHAT ARE APIs???
API stands for Application Programming Interface. An API is a set of protocols, routines and tools for building software application. In essence, an API specifies how software components should interact with each other.
They are commonly used to access web-based services and databases.
APIs can be public or private. Public APIs are available to developers and users outside of the organization that developed the API, while private APIs are designed for internal use only.
APIs are often categorized by the way they are accessed such as RESTful APIs, which are accessed using HTTP requests, or SOAP APIs, which use XML to communicate.
We will only discuss RESTful APIs in this post due to modern usage.
- WHAT ARE RESTful APIs
A RESTful API is a type of API that uses HTTP request to perform create, read, update and delete(CRUD) operations on resources.
RESTful API is an interface that two computer systems use to exchange information securely over the internet. Most business applications have to communicate with other internal and third-party applications to perform various tasks.
REST stands for Representational state transfer, which is a set of architectural principles to building web services.
In a RESTful API each resources is identified by a unique URL and HTTP methods such as GET, POST, PUT and DELETE are used to interact with the resources. For example, a GET request to a URL that represents a customer resource might return information about that customer, while a POST request to the same URL might create a new customer.
In addition, RESTful APIs of teen use standard HTTP status codes to indicate the success of failure of a request. For example, a 200 status code indicate a successful request, while a 404 status code indicates that the requested resource was not found.
- TYPES
There are several types of RESTful APIs, including:
Hypermedia APIs which uses APIs such as links and other navigational elements to allow clients to discover and navigate the APIs resources.
Search-bases APIs which allow clients to search for resources based on various criteria. They typically provide a search endpoint that accept query parameters and returns a set of results based on the search criteria.
Others are:
- Paginated APIs
- Streaming APIs
- File-based APIs
- CRUD-based APIs
Thanks so much for your time. The chapter 2 will be posted as soon as possible.
Top comments (2)
Wow! this was for me a meaningful article. I've met with that kind of term API in almost every search on web, and you explain as well as I expected. I'm eagerly waiting for the next chapter!
Next chapter has been posted.
Thanks so much for reading.