Introduction
Nested resources help organize related data in a clear way. They show how one thing belongs inside another.
Nested resources help organize related data in a clear way. They show how one thing belongs inside another.
/parent_resource/{parent_id}/child_resource/{child_id}/posts/123/comments/456
/users/42/addresses/7
/categories/5/productsThis request asks for chapter 3 inside book 10.
GET /books/10/chapters/3 HTTP/1.1 Host: example.com
Nested URLs make it easy to understand relationships between data.
Keep URLs simple and consistent for better API design.
Nested resources show how one item belongs inside another.
Use nested URLs to organize related data clearly.
Include parent and child IDs to find exact resources.
/users/10/orders/3, what resource does this URL represent?/projects/{projectId}/tasks/{taskId}. Which URL is incorrect to get task 7 of project 2?Pass the test and this pattern moves unknown