Tutorial
Learn API testing with Postman
Postman is where many testers send their first API request, and where plenty of teams keep their whole API test suite. These lessons go from a single GET to a collection that logs in, creates and deletes its own data, checks every response, and runs in CI on every commit.
Every request in the tutorial goes to the free test API at https://api.testingapis.com, and every test was run with Newman, Postman's command-line runner, before it was published. You can import the finished collection below and follow along, or build it yourself lesson by lesson. If you've never sent an HTTP request, start with sending requests with curl and Postman. Some endpoints need a free account; put your API key in the environment's apiKey variable and the collection sends it for you.
Download the collection
- Collectiontestingapis-postman-collection.json23 requests with tests, in folders that follow the lessons
- Environmenttestingapis-postman-environment.jsonbaseUrl, and an empty apiKey for your key
- Data fileproducts.csvSix rows for the data-driven lesson
In Postman, choose Import and drop in the two JSON files. The lessons say which folder to run when. Or fork the same collection from the TestingAPIs workspace on Postman.
8 lessons3 levelsFree
Beginner
3 lessonsSending requests, keeping them in a collection, and logging in once for the requests that follow.
- 01Your first requests in PostmanSend a GET and a POST, read what comes back, and save both in a collection.
- 02Collections, environments and variablesOne base URL for every request, and which value wins when two scopes disagree.
- 03Authorization and chaining requestsThe Authorization tab, and a login whose token the next requests pick up on their own.
Intermediate
3 lessonsTests that check every response, scripts that prepare requests, and one request run against many rows of data.
- 04Writing tests in Postmanpm.test and pm.expect for status, headers, body, timing and a JSON schema.
- 05Pre-request scripts and request flowsRandom test data, a signed request, a create-read-delete chain, and polling until a job finishes.
- 06Data-driven testing with the Collection RunnerOne request, a CSV file, and a test per row.
Advanced
2 lessonsRunning collections from the command line and in CI, and keeping a suite useful as it grows.
Postman is a trademark of Postman, Inc. This tutorial is independent and isn't affiliated with or endorsed by Postman, Inc.