Skip to content
  • RESTful APIs · API Design

RESTful APIs

LearnViaNotes @learnvianotes· 1 min read

Resource-based URL design, filtering, sorting, pagination, and versioning — the complete REST playbook.

URL patterns

Collection:
GET   /api/v1/products
POST  /api/v1/products

Specific resource:
GET    /api/v1/products/:id
PATCH  /api/v1/products/:id
DELETE /api/v1/products/:id

Nested (relationship):
GET /api/v1/products/:id/reviews

Actions (when needed):
POST /api/v1/orders/:id/cancel

Filtering, sorting, field selection

REST best practices

Plural nouns (/products not /product) · No verbs in URLs (GET /users/:id not /getUser) · Version with /v1, /v2 · Consistent response envelope · Return appropriate status codes · Never return unbounded lists · Never put credentials in URLs · Never return 200 for errors

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report