Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a path parameter in the URL.
Postman
GET https://api.example.com/users/[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using curly braces {} which is common in some frameworks but not in Postman.
Using angle brackets <> which are not valid for path parameters.
Using square brackets [] which are not used for path parameters.
✗ Incorrect
In Postman, path parameters are defined using a colon before the parameter name, like ':userId'.
2fill in blank
mediumComplete the code to set a path parameter value in Postman.
Postman
pm.variables.set('[1]', '12345');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic name like 'paramValue' instead of the exact path parameter name.
Using 'id' or 'pathParam' which do not match the URL parameter.
✗ Incorrect
The path parameter name must match the one used in the URL, here 'userId'.
3fill in blank
hardFix the error in the code to correctly use a path parameter in the request URL.
Postman
GET https://api.example.com/orders/[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using curly braces {} which are not recognized by Postman for path parameters.
Using angle or square brackets which cause errors.
✗ Incorrect
Postman requires path parameters to be prefixed with a colon ':' in the URL.
4fill in blank
hardFill both blanks to correctly define and set a path parameter in Postman.
Postman
GET https://api.example.com/products/[1] pm.variables.set('[2]', '98765');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for the URL parameter and the variable.
Including the colon ':' in the variable name when setting it.
✗ Incorrect
The URL uses ':productId' as the path parameter, and the variable 'productId' must be set in Postman.
5fill in blank
hardFill all three blanks to create a request URL with two path parameters and set their values in Postman.
Postman
GET https://api.example.com/[1]/[2] pm.variables.set('[3]', '555');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of parameters in the URL.
Including the colon ':' in the variable name when setting it.
Setting the wrong variable name that does not match the URL parameter.
✗ Incorrect
The URL has two path parameters ':category' and ':itemId'. We set the variable 'category' in Postman to '555'.