Bird
0
0

Given the REST API path /users/5/orders/12/items, what resource does this path represent?

medium📝 Predict Output Q13 of 15
Rest API - URL and Resource Design
Given the REST API path /users/5/orders/12/items, what resource does this path represent?
AAll orders of all users
BOrder 12 of user 5
CUser 5's profile information
DItems in order 12 of user 5
Step-by-Step Solution
Solution:
  1. Step 1: Break down the path segments

    /users/5 means user with ID 5, /orders/12 means order with ID 12 for that user, and /items means the items in that order.
  2. Step 2: Understand the full resource

    The path points to the items inside order 12 which belongs to user 5.
  3. Final Answer:

    Items in order 12 of user 5 -> Option D
  4. Quick Check:

    Path shows nested resources = items in order 12 of user 5 [OK]
Quick Trick: Read path left to right as parent to child resources [OK]
Common Mistakes:
  • Ignoring the nested order and item relationship
  • Confusing order with user profile
  • Assuming it lists all users or orders

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes