? REST API cheatsheet
? REST API cheatsheet
REST API
Cheatsheet
Ragini Pandey
2
Intro
REST (Representational State
Transfer) APIs are the foundation
of web services
Ragini Pandey
3
Simple to implement
Universally supported
Ragini Pandey
4
REST is Stateless
Meaning every request
Scalability
Reliability
Simplicity
Easy in Debugging & Testing
Ragini Pandey
5
Meaning of Resource
A resource is a specific piece of
information or data that you can
access, change, or interact with
through the API
Ragini Pandey
6
HTTP methods
Ragini Pandey
7
Examples
REST has it’s own language. The combination
of a resource URL and an HTTP method
defines the action
Ragini Pandey
8
📄 Pagination
GET /users?page=1&limit=20
🔍 Filter
GET /users?role=admin
⬆️ Sort
GET /users?sort=name&order=asc
Ragini Pandey
9
Common Mistakes in
naming endpoints I
1: Using Verbs Instead of Nouns
❌ Mistake ✅ Correct
GET /getUser GET /users
Ragini Pandey
10
Common Mistakes in
naming endpoints II
3: Including Actions in Endpoints
❌ Mistake ✅ Correct
DELETE /users/remove/1 DELETE /users/11
Ragini Pandey
11
Common Mistakes in
naming endpoints III
5: Missing Resource Identifiers
❌ Mistake ✅ Correct
PUT /users PUT /users/123
Ragini Pandey
12
Ragini Pandey
13
API Versioning
API versioning is the practice of managing changes
in your API while maintaining backward
compatibility for existing clients
Ragini Pandey
14
Implement token-based
authentication (OAuth2, JWT)
Ragini Pandey
15
Additional Tools
📑 Testing Tools
Postman
cURL
📜 Documentation Tools
Swagger (OpenAPI)
Postman Collections
Ragini Pandey
16
Similar technologies
Following technologies are used for
communication between systems, but they
serve different purposes and have distinct
characteristics
GraphQL
gRPC (Google Remote Procedure Call)
Socket Programming
Ragini Pandey
17
FOLLOW ME
FOR MORE
Ragini Pandey
@ragini-pandey-dev