Bird
0
0

How would you construct a URL to search for users whose name contains 'Sam' and are active, assuming the API supports name_contains and active=true parameters?

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

How would you construct a URL to search for users whose name contains 'Sam' and are active, assuming the API supports name_contains and active=true parameters?

A/api/users?name=Sam&active=true
B/api/users?name_contains=Sam&active=1
C/api/users?name_contains=Sam&active=true
D/api/users?name=Sam&active=1
Step-by-Step Solution
Solution:
  1. Step 1: Use correct parameter names

    The API supports name_contains to search partial matches and active=true for active users.
  2. Step 2: Check parameter values and syntax

    /api/users?name_contains=Sam&active=true uses both parameters correctly with proper values and syntax.
  3. Final Answer:

    /api/users?name_contains=Sam&active=true -> Option C
  4. Quick Check:

    Use exact parameter names and boolean values [OK]
Quick Trick: Match API parameter names exactly [OK]
Common Mistakes:
  • Using wrong parameter names
  • Using 1 instead of true for booleans

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes