Bird
0
0

Which of the following query parameters correctly requests only the id and name fields for a users resource?

easy📝 Syntax Q3 of 15
Rest API - Advanced Patterns
Which of the following query parameters correctly requests only the id and name fields for a users resource?
A/users?fields=users:id,name
B/users?fields[users]=id,name
C/users?fields(users)=id,name
D/users?fields[users]=id;name
Step-by-Step Solution
Solution:
  1. Step 1: Recall sparse fieldset syntax

    The correct syntax uses fields[resource]=field1,field2.
  2. Step 2: Analyze options

    /users?fields[users]=id,name matches the correct syntax; others use incorrect delimiters or formats.
  3. Final Answer:

    /users?fields[users]=id,name -> Option B
  4. Quick Check:

    Comma separates fields inside brackets [OK]
Quick Trick: Use fields[resource]=field1,field2 format [OK]
Common Mistakes:
MISTAKES
  • Using semicolons instead of commas
  • Misplacing brackets or parentheses
  • Using equal sign incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes