If you specialize in API development, you must have come across Postman, one of the market’s best API testing tools. Leveraged by several developers, this tool comes with powerful features that can make your work easier when creating and testing APIs. One unique feature that makes this tool outstanding is the postman collection, a set of pre-built requests grouped into folders for easier management, exportation, and sharing. Developers and testers can group postman requests into collections to collaborate with others, keep their workspace organized, automate test runs, and generate API documentation.
Contents
Step to Step Process of Creating a Postman Collection
You can create a postman collection using any of these three methods:
Method I:
On the postman app, scroll to the New button and hit the Collection option displayed below it. A new window will pop up with sections that you’re required to fill.
2. Add Collection Name and Description
The pop window that will manifest after clicking the Collection option will have several categories. Start by naming your collection and giving it an optional description.
3. Select Authorization Type
Next to the description option, you’ll see the authorization option, click on it, and choose the authorization type.
4. Add a pre-request script.
The next step is to add the pre-request script. The script executes before any request stored in the collection.
5. Add tests
Click on the test option and add tests. These will execute after every request in the collection
6. Add the required variables
Hit the variable option and input the variables. They should be specific to the specific collection and its requests.
7. Hit the Create Button
Once you have filled every section, you can now click the create button to save your collection.
Method II: Creating a Postman Collection Using the Launchpad
1. Open the Postman app.
Navigate to the builder section and then the launch pad.
2. Create Collection
Navigate to the Start Something New tab and hit the Create Collection Option
3. Fill in the details in the window that pop’s up once you click the Create a Collection option
Here you’ll have to fill the fields like in the first method. These include things like:
- Collection name and description
- Authorization type
- Pre-request script
- Tests
- Variables
Method III: Creating a Collection Using Postman’s Sidebar
Once you hit this tab, a new collection option will be displayed.
Click on the new collection option and move to the next step.
2. Fill in all the sections of the window that will pop up after clicking the new collection option.
Again, like in method I and II, you’ll need to:
- Name your collection and add a description
- Select the authorization type
- Add pre-request script
- Add tests
- Add variables
How Do You Save a Request to a Collection?
Once you have created your postman collection, you can now make a new request and save it. You can create your request from:
- The create a request option on the launch screen.
- New button on the sidebar
- Builder section
Regardless of the method you use, a window like the one displayed below will pop up.
- Add a request name and optional request description.
- Choose the folder or collection you want the request to be saved in
- Hit the save button to ensure that the request is stored in your preferred Postman Collection.
What Next?
Convert your Postman Collection to OpenAPI
Now that you have created your Postman Collection, you may need to convert the format to OpenAPI for various tools and services. Convert your Postman Collection to OpenAPI for Free through APITransform.