Skip to content
Home » Insights » What is REST API?

What is REST API?

REST API (Representational State Transfer Application Programming Interface) is a web service architecture. This architecture encompasses a set of standards that represent resources and define operations performed on these resources. REST typically communicates over the HTTP protocol but can also be used with other protocols.

Resource Representation: Each resource is represented by a URI (Uniform Resource Identifier). These resources are typically data represented in JSON or XML format.

Lightweight Communication: REST communicates using existing communication protocols like HTTP, contributing to the overall lightweight nature of the application.

Statelessness: Each request contains its context, and the server does not store this context. Every request must carry all the relevant information with it.

Layered Architecture: REST follows a layered architecture, making the application modular and more sustainable.

Interconnected Systems: RESTful services can interact with each other, enabling access to a resource in one system through other interconnected systems.

REST APIs often support CRUD (Create, Read, Update, Delete) operations. For example, in a book store application, CRUD operations could be as follows:

Create: Use a POST request to add a new book.

Read: Use a GET request to view specific book details.

Update: Use a PUT or PATCH request to update book information.

Delete: Use a DELETE request to remove a book.

Commonly Used Status Codes

CodeMeaningDescription
200OKThe request was successfully processed.
201CreatedThe resource was successfully created.
204No ContentThe request was successful, but there is no content to return.
400Bad RequestThe request could not be understood or processed by the server.
401UnauthorizedAuthentication failed or user lacks necessary permissions.
403ForbiddenThe request was valid, but the server refuses to respond.
404Not FoundThe requested resource could not be found.
405Method Not AllowedThe request method is not supported for the requested resource.
409ConflictThe request could not be completed due to a conflict with the current state of the target resource.
500Internal Server ErrorAn unexpected error occurred on the server.
503Service UnavailableThe server is currently unable to handle the request, usually due to temporary overloading or maintenance of the server.
This table contains the English equivalents of commonly used HTTP status codes.

REST APIs can be utilized for a wide range of applications and were developed to standardize the interaction of web-based services.