QA
Beginner LevelREST APIs & Web Services

What are RESTful Resource Naming Conventions and URL path structures?

❓ Interview Prompt: Explain clean URI design rules, plural nouns, hierarchical relationships, and avoiding RPC-style verbs in paths.

RESTful APIs center around Resources represented by clean, predictable URIs:

URI Naming Rules:

1
Use Plural Nouns: '/api/v1/users' instead of '/api/v1/user'.
2
Avoid Action Verbs: Use '/api/v1/orders' with 'DELETE' instead of '/api/v1/deleteOrder' (RPC style).
3
Use Hyphens for Readability: '/api/v1/user-profiles' (avoid underscores or camelCase).
4
Express Hierarchy: '/api/v1/users/42/orders/101' (Order 101 belonging to User 42).
5
Lowercase Letters: URIs are case-sensitive; keep all path segments strictly lowercase.

Code Implementation Example

http
GET    /api/v1/products           # Fetch list of products
POST   /api/v1/products           # Create new product
GET    /api/v1/products/88        # Fetch product 88
PUT    /api/v1/products/88        # Replace product 88
DELETE /api/v1/products/88        # Remove product 88
GET    /api/v1/products/88/reviews # Fetch reviews for product 88
💡Clean RESTful URI naming hierarchy for product resources.
🎯 Interview Key Takeaway

URIs should use plural nouns and hierarchical structures while relying on HTTP verbs to express CRUD actions.

#URI Design#REST API#Naming Conventions#Beginner
Back to all REST APIs & Web Services Questions→

More REST APIs & Web Services Interview Questions

Beginner LevelREST APIs & Web Services

What is HTTP Method Idempotency and how do you implement Idempotency Keys for REST APIs?

Beginner LevelREST APIs & Web Services

What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?

Beginner LevelREST APIs & Web Services

What are HTTP Verbs (GET, POST, PUT, PATCH, DELETE) and when to use PUT vs PATCH?