0
0
Rest APIprogramming~10 mins

Why flexible querying empowers clients in Rest API - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a query parameter for filtering users by age.

Rest API
GET /users?age=[1]
Drag options to blanks, or click blank then click option'
Asort
B30
Climit
Dfilter
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameter names instead of values
Using unrelated query parameters
2fill in blank
medium

Complete the code to limit the number of results returned by the API.

Rest API
GET /products?[1]=10
Drag options to blanks, or click blank then click option'
Asort
Bfilter
Climit
Doffset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'filter' or 'sort' instead of 'limit'
3fill in blank
hard

Fix the error in the query parameter to sort users by name ascending.

Rest API
GET /users?sort=[1]
Drag options to blanks, or click blank then click option'
A-name
Basc
Cdesc
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-name' for ascending order
Using 'asc' which is not accepted here
4fill in blank
hard

Fill both blanks to filter products by category and sort by price descending.

Rest API
GET /products?[1]=electronics&[2]=-price
Drag options to blanks, or click blank then click option'
Afilter
Bcategory
Csort
Dlimit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'filter' as a parameter name instead of 'category'
Using 'limit' instead of 'sort'
5fill in blank
hard

Fill all three blanks to create a query that filters users by active status, limits results to 5, and sorts by signup date ascending.

Rest API
GET /users?[1]=true&[2]=5&[3]=signup_date
Drag options to blanks, or click blank then click option'
Aactive
Blimit
Csort
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'status' instead of 'active'
Using 'sort' as a value instead of parameter name