Bird
0
0

Which of the following is the correct syntax to request only the title and author fields of a books resource using sparse fieldsets?

easy📝 Syntax Q12 of 15
Rest API - Advanced Patterns
Which of the following is the correct syntax to request only the title and author fields of a books resource using sparse fieldsets?
A/books?select=title,author
B/books?fields[books]=title,author
C/books?fields=title&fields=author
D/books?filter=title,author
Step-by-Step Solution
Solution:
  1. Step 1: Recall sparse fieldsets syntax

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

    /books?fields[books]=title,author matches the correct syntax: /books?fields[books]=title,author.
  3. Final Answer:

    /books?fields[books]=title,author -> Option B
  4. Quick Check:

    Correct syntax = fields[resource]=fields [OK]
Quick Trick: Use fields[resource]=field1,field2 format [OK]
Common Mistakes:
MISTAKES
  • Using 'select' instead of 'fields[resource]'
  • Using multiple 'fields' parameters incorrectly
  • Confusing 'filter' with field selection

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes