Design consistent, versioned REST APIs that clients can rely on — the backbone of modern backend work.
REST API fundamentals every backend engineer must know:
HTTP Methods:
- GET — retrieve a resource (idempotent)
- POST — create a resource
- PUT — replace a resource (idempotent)
- PATCH — partial update
- DELETE — remove a resource (idempotent)
Status Codes:
- 2xx Success: 200 OK, 201 Created, 204 No Content
- 3xx Redirect: 301 Moved, 304 Not Modified
- 4xx Client Error: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable Entity
- 5xx Server Error: 500 Internal Server Error, 503 Service Unavailable
Best Practices:
- Versioning: /api/v1/users
- Pagination: cursor-based or page-based
- Consistent error format (RFC 7807 Problem Details)
- HATEOAS (optional but powerful)
- Idempotency keys for payment APIs
Documentation:
- OpenAPI / Swagger spec
- Postman collections
HTTP Methods:
- GET — retrieve a resource (idempotent)
- POST — create a resource
- PUT — replace a resource (idempotent)
- PATCH — partial update
- DELETE — remove a resource (idempotent)
Status Codes:
- 2xx Success: 200 OK, 201 Created, 204 No Content
- 3xx Redirect: 301 Moved, 304 Not Modified
- 4xx Client Error: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable Entity
- 5xx Server Error: 500 Internal Server Error, 503 Service Unavailable
Best Practices:
- Versioning: /api/v1/users
- Pagination: cursor-based or page-based
- Consistent error format (RFC 7807 Problem Details)
- HATEOAS (optional but powerful)
- Idempotency keys for payment APIs
Documentation:
- OpenAPI / Swagger spec
- Postman collections