Today, we’re going to take this one step forward and emulate 2 awesome Spotify features for music discovery – Discover Weekly and Daily Mix. And we’ll use 2 new features in the Postman Pro arsenal to do this—Postman Monitors and the Postman Pro API.
The Postman Pro API exposes several endpoints to help you integrate Postman more deeply with your development toolchain. Using the API, you can create and update collections and environments, and run monitors, simultaneously syncing each action with your Postman app. All new features (e.g., Postman Mock Service) will be launched first via the API before making their way into the app.
As you would have guessed by now, we’ll use Postman Monitors to run our simple yet effective music discovery collections once a day (or week) on the cloud.
Quickly jotting down the workflow:
- Add a new request to our collection which updates the environment at the end of the run using the Postman Pro API. This allows us to emulate the Persist Variables feature in the app.
- Create a monitor with the updated collection and environment.
This is what our updated workflow looks like:
Click the Run in Postman button below to get the collection and environment into your Postman app.
Create the Monitor
- First, make sure you run the collection in the app with the new environment template. You’ll have to set up the environment as explained in the previous post.
- Now head to the Postman Monitors. If you’re not already on Postman Pro, you can start a free trial.
- Create a new monitor selecting the downloaded collection and environment template. In the screenshot, I’ve set it to run every morning at 9AM.
- Go to the details view, and you’ll see this screen
- Click on the Run Now button (next to Edit Monitor) to check if everything works fine.
- Finally, after a few manual or scheduled runs, your monitor results should look something like this!
Since we’re using the Postman Pro API to update the environment in the final request, we constantly expand our list of artists as shown below. Personally, I have discovered entirely new and obscure genres using this monitor!
I hope you found this series to be useful and an insight into the hard work we’re putting into making Postman Pro the most comprehensive toolchain for API developers. Stay tuned for similarly fun use cases of the Postman ecosystem.
What do you think about this topic? Tell us in a comment below.