Bird
0
0

You receive a REST API response sorted by score ascending, but you want it descending. How do you modify the API call?

hard📝 Application Q9 of 15
Rest API - Query Parameters and Filtering

You receive a REST API response sorted by score ascending, but you want it descending. How do you modify the API call?

AAdd <code>order=descending</code> parameter
BChange <code>sort=score</code> to <code>sort=score_desc</code>
CChange <code>direction=asc</code> to <code>direction=desc</code>
DRemove the <code>direction</code> parameter
Step-by-Step Solution
Solution:
  1. Step 1: Identify current direction

    The current direction is 'asc' meaning ascending order.
  2. Step 2: Modify direction to descending

    Change 'direction=asc' to 'direction=desc' to reverse the order.
  3. Final Answer:

    Change direction=asc to direction=desc -> Option C
  4. Quick Check:

    Switch asc to desc to reverse sort [OK]
Quick Trick: Switch asc to desc to reverse order [OK]
Common Mistakes:
  • Changing sort field incorrectly
  • Adding unsupported parameters
  • Removing direction parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes