What you will learn
Continue with Beginner API Lab from the previous lesson. A variable stores a value under a name. Postman replaces {{name}} before sending. Changing the saved value changes the outgoing URL without rewriting the request.
Your goals
- Send the same kind of request to user 1 and user 99.
- Tell a saved name apart from the URL that was sent.
Before you start
Read the previous lesson first if you have not already. This course does not require programming.
Practice setup
These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.
Follow these steps
- Open Beginner API Lab in Postman. On its Variables tab add baseUrl with value https://testkru.com/api and userId with value 1. Save.
- Add a request named Variable user with URL {{baseUrl}}/users/{{userId}}, method GET, No Auth and no body. Send it and inspect the resolved request URL in the Postman Console.
- Change the collection userId value to 99, save and send the same request again. Check the resolved URL and response. Avoid environment variables with the same names for this first exercise.
- Reproduce both resolved URLs in the course console and select their responses. Answer which value the server received.
- Export the updated collection as v2.1 JSON with userId still 99. Paste it in the collection field and submit. Keep the file and collection for the later authentication and sharing lessons.
Investigate before concluding
First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.
What to keep as evidence
- Both user ids are requested.
- The statuses are copied from the selected responses.
- The sent URL is distinguished from a saved name.
References for this lesson
Finish this assignment
Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.
If something goes wrong
- Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
- Both user ids are requested.
- The statuses are copied from the selected responses.
- The sent URL is distinguished from a saved name.
Predict what happens if {{baseUrl}} is left unresolved. The client may reject it before any HTTP response.
Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.