0
0
Rest APIprogramming~10 mins

Endpoint documentation structure 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 HTTP method for the endpoint.

Rest API
"method": "[1]",
Drag options to blanks, or click blank then click option'
AGET
BPOST
CPUT
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Using POST instead of GET for data retrieval.
2fill in blank
medium

Complete the code to define the endpoint's URL path.

Rest API
"path": "/api/[1]",
Drag options to blanks, or click blank then click option'
Acreate
Bdelete
Cusers
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using action verbs like create or delete in the path.
3fill in blank
hard

Fix the error in the parameter definition by completing the type field.

Rest API
"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "[1]"}}],
Drag options to blanks, or click blank then click option'
Ainteger
Bstring
Cboolean
Darray
Attempts:
3 left
💡 Hint
Common Mistakes
Using string instead of integer for numeric IDs.
4fill in blank
hard

Fill both blanks to complete the response status code and description.

Rest API
"responses": {"[1]": {"description": "[2]"}}
Drag options to blanks, or click blank then click option'
A200
B404
CSuccess
DNot Found
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing status codes and descriptions incorrectly.
5fill in blank
hard

Fill all three blanks to complete the request body schema definition.

Rest API
"requestBody": {"content": {"application/json": {"schema": {"type": "[1]", "properties": {"name": {"type": "[2]"}, "age": {"type": "[3]"}}}}}}
Drag options to blanks, or click blank then click option'
Aobject
Bstring
Cinteger
Darray
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing data types for properties.