Bulk POST/PUT API Requests Using POSTMAN Or Any Other Means


Answer :

Never mind I figured out a way to use postman's collection runner to accomplish the same. For those who struggled like the way I did, here is how to use that feature and its even easier to substitute values to your url on the go.

First create a request in Postman:

Below is a screenshot for Example:

enter image description here

Now the requirement is to post the below url: https://someApiPOSTRequest/clientAssign?auth=123|asdf&otherParamsList=123Params&someOtherParams={{VariableFromFile}}&additionalParams=hardcodedOnURL

with values being substituted for {{VariableFromFile}} from the csv file you will need to upload. Your csv should be formatted as below, where the header should have the same variable name used on your url:

enter image description here

Click on the '>' button shown below beside Example folder and click on 'Run' to open the same on Collection runner window of postman:

enter image description here

Once the Collection Runner window opens up, click on select file option to upload your csv file, and the Iterations field is pre-filled with the number of records on the csv file by default. You can change the number and when you do make sure of the number of iterations you want to run as its directly related to number of rows in your uploaded csv.

enter image description here

You can also preview your uploaded csv file:

enter image description here

If you click on Run Example button, the collection runner posts the url 9 times with {{VariableFromFile}} being substituted with value from csv file for each iteration.

You can have more variables substituted by just having one more column with the relevant variable name and using the same on your api call. Its just that simple. It did reduce a lot of manual work for me!!

You can also refer to the below link which guided me to use this feature in Postman. Link

Hope this will be helpful for someone.


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable