0
0
Rest APIprogramming~10 mins

Sparse fieldsets (select fields) 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 select only the 'name' field in the API request.

Rest API
GET /users?fields=[1]
Drag options to blanks, or click blank then click option'
Aname
Ball
Cid
Demail
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' returns all fields, not sparse fields.
Using 'id' or 'email' selects different fields, not 'name'.
2fill in blank
medium

Complete the code to select both 'name' and 'email' fields in the API request.

Rest API
GET /users?fields=[1]
Drag options to blanks, or click blank then click option'
Aname email
Bname;email
Cname,email
Demail,name
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons or spaces instead of commas.
Reversing the order is okay but must use commas.
3fill in blank
hard

Fix the error in the code to correctly select the 'title' field for posts.

Rest API
GET /posts?fields=[1]
Drag options to blanks, or click blank then click option'
Atitle;content
Btitle
Ctitle,content
Dcontent
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas.
Selecting multiple fields when only one is needed.
4fill in blank
hard

Complete the code to select 'id' and 'username' fields for users.

Rest API
GET /users?fields=[1],username
Drag options to blanks, or click blank then click option'
Aid,
B;
C,
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas.
Not adding a separator between fields.
5fill in blank
hard

Complete the code to select 'author', 'date', and 'summary' fields for articles.

Rest API
GET /articles?fields=[1],date,summary
Drag options to blanks, or click blank then click option'
Aauthor,
B;
C,
Dauthor
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas.
Missing commas between fields.