0
0
Rest APIprogramming~10 mins

Multiple filter parameters in Rest API - Interactive Code Practice

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

Complete the code to add a filter parameter named 'status' to the API request URL.

Rest API
url = "https://api.example.com/items?[1]=active"
Drag options to blanks, or click blank then click option'
Atype
Bfilter
Cstatus
Dcategory
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong parameter name like 'type' or 'category' instead of 'status'.
2fill in blank
medium

Complete the code to add a second filter parameter 'category' to the API request URL.

Rest API
url = "https://api.example.com/items?status=active&[1]=books"
Drag options to blanks, or click blank then click option'
Atag
Bcategory
Cfilter
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'type' or 'filter' instead of 'category'.
3fill in blank
hard

Fix the error in the code to correctly add multiple filter parameters to the API request URL.

Rest API
url = "https://api.example.com/items?status=active[1]category=books"
Drag options to blanks, or click blank then click option'
A&
B?
C;
D#
Attempts:
3 left
💡 Hint
Common Mistakes
Using '?' again instead of '&' to separate parameters.
4fill in blank
hard

Fill both blanks to create a URL with three filter parameters: status, category, and sort.

Rest API
url = "https://api.example.com/items?status=active[1]category=books[2]sort=asc"
Drag options to blanks, or click blank then click option'
A&
B?
C#
D;
Attempts:
3 left
💡 Hint
Common Mistakes
Using '?' or '#' instead of '&' between parameters.
5fill in blank
hard

Fill all three blanks to build a URL with filters for status and a limit parameter.

Rest API
url = "https://api.example.com/items?[1]=active[2][3]=10"
Drag options to blanks, or click blank then click option'
Astatus
B&
Climit
Dcategory
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up parameter names or forgetting the '&' separator.