0
0
Rest APIprogramming~10 mins

Resource identifiers in URLs 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 specify the resource identifier in the URL.

Rest API
GET /users/[1] HTTP/1.1
Drag options to blanks, or click blank then click option'
A123
Busers
Cprofile
Dapi
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource name again instead of the identifier.
Using a generic term like 'api' instead of an ID.
2fill in blank
medium

Complete the URL to access the order with the given identifier.

Rest API
GET /orders/[1] HTTP/1.1
Drag options to blanks, or click blank then click option'
A456
BorderId
Cdetails
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using a word like 'orderId' instead of the actual ID value.
Using 'list' which refers to a collection, not a single resource.
3fill in blank
hard

Fix the error in the URL by correctly placing the resource identifier.

Rest API
GET /products/[1]/reviews HTTP/1.1
Drag options to blanks, or click blank then click option'
Alist
B789
Creviews
Dproducts
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'reviews' as the identifier instead of the product ID.
Placing the identifier in the wrong position in the URL.
4fill in blank
hard

Fill both blanks to correctly form the URL for accessing a specific comment on a post.

Rest API
GET /posts/[1]/comments/[2] HTTP/1.1
Drag options to blanks, or click blank then click option'
A101
Bcomments
C202
Dposts
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the post and comment identifiers.
Using resource names instead of IDs in the blanks.
5fill in blank
hard

Fill all three blanks to create a URL that accesses a specific chapter of a book in a library API.

Rest API
GET /libraries/[1]/books/[2]/chapters/[3] HTTP/1.1
Drag options to blanks, or click blank then click option'
Alib42
Bbook7
Cch3
Dchapter
Attempts:
3 left
💡 Hint
Common Mistakes
Using resource names like 'chapter' instead of the chapter ID.
Mixing up the order of identifiers.