- Published on
REST API - Introduction
- Authors
- Name
- Iraianbu A
Table of Contents
Introduction
Introduction
REST (Representational State Transfer) is a architectural style for designing networked applications that leverages the HTTP protocol for communication between systems over the internet. REST APIs utilize standard HTTP methods like GET, PUT, POST, and DELETE to perform operations on resources, making them intuitive and widely compatible.

Source : https://www.postman.com/what-is-an-api/
API Fundamentals
An Application Programming Interface (API) serves as a mediator between different software applications, enabling them to communicate and exchange data without direct access to each other's internals. APIs define the structure of requests and responses, creating standardized methods of interaction.
Examples of APIs
- Weather APIs
- Uber driver APIs
- DOM (Document Object Model) APIs
API Classifications
Access Level
- Public APIs: Open for any developer to use
- Private APIs: Restricted to internal use within organizations
Communication Methods
- REST: Resource-based approach using HTTP methods
- SOAP: Protocol using XML for structured message exchange
- GraphQL: Query language allowing clients to request specific data
- gRPC: High-performance RPC framework using protocol buffers
Data Format
- JSON: Lightweight, human-readable format
- XML: More verbose but highly structured
- Plain text: Simple string responses
Processing Approach
- Real-time: Immediate processing and response
- Batch Processing: Handling multiple requests together
Authentication Methods
- API Keys: Simple token-based access
- OAuth: Token-based authorization framework
- JWT: Self-contained tokens with encoded claims
REST Principles
Client-Server Architecture
A separation of concerns where clients send requests to servers that process them and return appropriate responses. This separation allows each component to evolve independently.
Statelessness
Each request from client to server must contain all information needed to understand and process the request. The server doesn't store client session information between requests, simplifying server implementation and improving scalability.
Uniform Interface
Standardized methods of interaction through:
- Consistent resource identification via URLs
- Standard HTTP methods (GET, POST, PUT, DELETE)
- Self-descriptive messages
- Hypermedia as the engine of application state (HATEOAS)
Cacheability
Responses must define themselves as cacheable or non-cacheable to prevent clients from reusing stale data and improve performance by reducing redundant requests.
Layered System
Architecture allowing intermediaries (proxies, gateways, load balancers) between client and server without affecting the interface or functionality.
Code on Demand (Optional)
Servers can temporarily extend client functionality by transferring executable code.
Challenges
- Error Handling
- Versioning
- Pagination
- Security