Bird
0
0

Which of the following is the correct REST API endpoint syntax for accessing a single user resource by ID?

easy📝 Syntax Q12 of 15
Rest API - URL and Resource Design
Which of the following is the correct REST API endpoint syntax for accessing a single user resource by ID?
A/users/get/123
B/user?id=123
C/users/123
D/getUser/123
Step-by-Step Solution
Solution:
  1. Step 1: Review REST API syntax for single resource

    Single resources are accessed by appending the resource ID to the plural noun path.
  2. Step 2: Identify the correct syntax

    Option '/users/123' correctly uses the plural noun 'users' followed by the ID without verbs or query parameters.
  3. Final Answer:

    /users/123 -> Option C
  4. Quick Check:

    Single resource path = /users/123 [OK]
Quick Trick: Use /resourceName/{id} for single resource access [OK]
Common Mistakes:
MISTAKES
  • Adding verbs like 'get' in the path
  • Using query parameters instead of path variables
  • Using singular noun without ID

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes