4 Tips for Becoming a Postman Guru

4 Tips for Becoming a Postman Guru

4 Tips for Becoming a Postman Guru 736 313 Heather Post

In my experience, an API is to a developer is what peanut butter is to chocolate and sunshine is to baseball games: almost a necessity. Utilizing APIs allows developers to incorporate code they didn’t have to develop themselves. This code can provide additional functionality, access external data, or interact with other programs seamlessly. It’s something I use in my code often to avoid the time and cost of developing more complex features in-house. I think I can sum it up by saying that APIs make a developer’s life much easier.

The good news is, the number of APIs out there seems limitless. But how can I tell which API to go with? Or test a new API I’m working on? In the past, it was common practice to build a quick program that would call API requests so programmers could test it. This was very time consuming and today, like many developers, I have replaced this tedious method with Postman.

I know I’m not alone–currently 15 million developers and half a million companies around the world utilize Postman for development. As an API company, DataMotion’s development team utilizes Postman often, and understands how incredibly useful the tool can be. Through extensive use and some research, my colleagues and I have found there are many tips and tricks to using Postman, which I think you’ll find extremely helpful while testing APIs and building your collections. Before diving into these tips and tricks, allow me to provide a (brief) overview of what Postman is, just in case you don’t already know or if you need a quick refresher.

What is Postman?

Postman is an API testing application that has an easy-to-use UI and ample API collections. The collections are created by a third party (usually the company that developed the API) and contain the request details I need to make an API call. In my experience, there occasionally are some extra steps that need to be taken before I can test, such as creating an account and providing the account credentials before making the call. Once I take those extra steps and obtain any additional information (like credentials) I just need to plug and play.

Now, back to those tips. Over the past two months, I have shared some Postman tips and tricks on DataMotion’s social media pages and still have more to come. You can check them out on our LinkedIn, Facebook, and Twitter pages, but to make your day easier, I went ahead and gathered the tips that have been shared thus far. Below, I will review each tip and help you become a Postman guru!

The Postman Tips and Tricks Roundup (So Far)

First Tip: Utilize bulk edit to copy and paste params or headers from one request to another.

The first tip I’d like to review has to do with updating headers and parameters in your collection’s requests. I can’t tell you how many times I manually added the same headers for each request, one at a time. This is where bulk edit saves the day!

Within the Header and Params sections there is a ‘Bulk Edit’ option in the top right corner of the tables. You can select this option to see the list of headers or params in text rather than in a table format. This allows you to copy all of the text and move to your new request. In the same section of your new request, select ‘Bulk Edit’ again and paste the text within. From here you can select ‘Key Values’ which has replaced the bulk edit option to see all of your headers or params in the table format. The GIF below will display this functionality further.

Postman Tip 1, use bulk edit to copy and paste params or headers

Easy peasy, right?

Second Tip: Make use of variables within a folder or collection for data that is repeated in multiple requests.

The second Postman tip I will review involves variables. You can make use of these variables within a folder or collection for data that is repeated in multiple requests. For example, in the DataMotion collections we have a header for a session key in most of our requests. When the session key updates, rather than having to copy and paste it into each request, you can instead create a variable and update the session key variable’s value. You can then use the following format to reference the variable in your requests; {{variable}}. Now when you need to update the data, you will only need to do so in one location.

Third Tip: Test your requests in bulk by clicking your collection then adding a test script in the “Test” tab.

Whether you’re a fan of QA or not, it is almost entirely unavoidable as a developer. Luckily, within Postman you can test multiple requests with the same script. To do so, click on the folder or collection that holds the requests you would like to test. Select the ‘Test’ tab at the top of the page and add the test code you would like to run against your requests. Now you can run your collection and test multiple requests at once. Below I demonstrate how this is done.

Postman Tip 3, test requests in bulk by clicking collection then adding a test script in the test tab

Fourth Tip: To run a request without a header or parameter, deselect the check box next to each. This lets you quickly disable and reenable any headers or parameters.

The fourth tip is a simple one that often comes in handy. Oftentimes, you may need to send a request with multiple parameters; conversely, you may need to send the same request without any. Rather than deleting your parameters and adding them back when necessary, you can quickly disable and reenable a header or parameter by deselecting the check box next to each. This lets you run the request with only the enable parameters/headers included. (I also did a mental face palm when I realized this trick!)

Postman Tip 4, run a request without a header or parameter by deselecting the checkbox next to each

More Tips Are on The Way!

If APIs are as compatible to developers as sunshine is to a baseball game, then we felt that we should shed some light on API testing tips and tricks for our developer audience. Being that the developers at DataMotion utilize Postman extensively, and we know 15 million of you do as well, we are happy to share our knowledge!

Don’t worry though, this is only an intermediate recap. We have another four Postman tips for you coming soon, which will be posted on our Twitter, Facebook , and LinkedIn pages every Tuesday. Be sure to check them out! You can also find Postman demo videos on the DataMotion Blog for an intro into Postman or quick refreshers.

To test DataMotion secure message APIs, you can download our Postman collections on GitHub. To find out more on how our secure message APIs can help you visit datamotion.com today!

Resources: