Working with Postman Workflows, Visualizations and Multiple APIs

Hey there Postman Community,
I wanted to take this time to share with you all a project that I have been working on during my first few months here at Postman!

I recently published this blog post which was all about using multiple APIs ( Twitter PositionStack and OpenWeather APIs) to visualize my globally distributed team members.
Visualizing a Globally Distributed Team Using Multiple APIs | Postman Blog

The heart of this project is all about working with various different kinds of APIs and building automated scripted workflows.

As the saying goes - there’s more than one way to skin a cat :scream_cat: With that in mind, I’d like to share with you all the various different ways you can go about working with multiple APIs through my collection.

Feel free to fork and follow along. Hopefully this will help some of you as you think about how you can build out your workflows.

  1. Individual Postman Requests

    • This folder shows how you can call each API - Twitter User by Username, Position Stack and Open Weather individually for each Twitter User. In this case we have 7 twitter users on the DevRel team, therefore there are individual get requests for each api for each twitter user.

    • The test tabs for each of these requests convert data returned back from the API into an object that is then serialized and set as an environment variable. Data from each API is then added to the initial object that’s created. This is a great blog post on the topic if you find yourself working with JSON Serialization

    • You can run through this folder using the collection runner or step through each request individually! you should see the objects for each user get updated as you go, feel free to try it out with your own twitter community!

  2. Using pm.sendRequest

    • This folder shows how you can consolidate the individual Postman requests by sending APIs and building objects within test scripts for each Postman request.

    • You can do this in three two and one postman request where you capture data from APIs as well as visualize data. The idea here is to consolidate as much as possible by sending requests from scripts in tests using the pm.sendRequest() method

    • Check our the pre-request and the test tabs for 3,2,1 postman request folders to see how multiple APIs are called in single requests

  3. Using Request Workflows

    • This folder shows how you can loop over the same request while changing the parameters using the Collection Runner and the postman.setNextRequest() function.

    • In this scenario there is a template being built for each API request which can be executed based on the index of each of the usernames in environment variable usernames . Check out Building request workflows to learn more about how this workflow is created and then use the collection runner to run this folder!

I worked to find these 3 specific ways to visualize my team members. If you happen to discover another workflow feel free to contribute back to this collection and share with me your thoughts and ideas!

Happy coding :smile:

1 Like