Abstracting Away API Response Complexity With Postman Visualizer
10 Dec 2019
I was creating a Postman collection for validating the status of Twitter users, where I was looking to extract a subset of data from the very verbose Twitter API response for a Tweet Lookup. There is a lot of data contained within a single Tweet JSON response, and all I was looking for was just a handful of the fields. I thought this would be a great opportunity to show off the new Postman visualizer, where you can display the API response for each request however you want.
To get started I crafted an API request for the Twitter lookup API path, allowing me to pass in up to 100 Twitter user handles, and return a JSON response for all the Twitter users I want to check in on the status of—leveraging Postman to authorize and see the details of the API response.
This res[omse has the data I need, but looking through the entire of the JSON response is a lot more than I can ask of many of the people I will be sharing the collection with. I’m going to be sharing it with mostly non-developers, hoping to provide them them with a quick way to check the status of various Twitter users, and wading through the JSON is unacceptable, so I used the new Postman visualizer to render an HTML list of only the data I wanted.
The Postman visualizer allows me to pull only the fields I need and publish as HTML to the visualizer tab. Providing a more human readable view of the Twitter Lookup API response, making the Twitter API more accessible by developers and non-developers who are looking for a quick way to validate the status of one or many Twitter users.
This is a pattern I want to keep applying and evolving. It represents everything I love about APIs. Providing simple, useful API capabilities that anyone can run. Making APIs more accessible to developers, as well as non-developers. While there is still more authentication friction with some of these collections I’m producing, I am still happy with the overall ability to package up an API call in this way. Providing shareable and executable machine and human readable units of digital value which makes APIs much more accessible and usable.