Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the HTTP method for the endpoint.
Rest API
"method": "[1]",
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using POST instead of GET for data retrieval.
✗ Incorrect
The HTTP method GET is used to retrieve data from the server.
2fill in blank
mediumComplete the code to define the endpoint's URL path.
Rest API
"path": "/api/[1]",
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using action verbs like create or delete in the path.
✗ Incorrect
The path /api/users typically represents the users resource.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string instead of integer for numeric IDs.
✗ Incorrect
The id parameter is usually an integer representing a resource identifier.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing status codes and descriptions incorrectly.
✗ Incorrect
Status code 200 means the request was successful, described as Success.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing data types for properties.
✗ Incorrect
The request body is an object with properties: name as a string and age as an integer.