This article was originally published on the Postman blog on August 18th, 2023.
With the power of Postman, the options for dynamically creating content with third-party platforms and tools are seemingly endless. This was the inspiration for a recent Postman livestream exploring how we can leverage the Miro Developer Platform's REST APIs to create content on a Miro board - all from within Postman.
Before diving into the details of how you can streamline your workflow with Postman and unlock new possibilities in Miro, let's start with a quick primer: what is visual collaboration in Miro? Well, simply put, it's a collection of connected activities that allow you to communicate and collaborate across formats, tools, channels, and time zones - without the constraints of physical location, meeting space, and whiteboards.
The Miro Developer Platform allows you to extend the power of visual collaboration and interact with Miro boards via its robust suite of REST APIs.
Getting started
In order to use the Miro REST API with Postman, you’ll need to first make sure you have a Miro account and some developer credentials to generate an access_token. You can find all the necessary details to get started here.
Miro Postman Collection
To make things even easier, you can leverage the Miro Developer Platform public collection in Postman, which includes an authorization helper to make getting an access token a breeze. By simply entering any Miro endpoint into Postman, you’ll see an option to set up a new authorization method, providing a frictionless experience for accessing Miro’s APIs (more details on this awesome new helper here).
Generating sticky notes dynamically from Postman
Once you’ve authorized and have your access_token saved to your Postman environment, you’re ready to make a request to the Miro API.
But rather than just make a single request that, for instance, creates a sticky note on a Miro board, let’s take advantage of Postman variables and the Postman Collection Runner feature to automate a number of requests, using some content from outside of Postman.
To do this, we can navigate to the Sticky Notes folder in the Miro Developer Platform collection, and leverage the Create Sticky Note Item endpoint. Navigate to the Body tab in Postman, and you’ll see some JSON already populated for the body of the request. For the content field in the request body, we can create a new environment variable—{{content}}
. We can do the same for the x, y fields in the position object—{{x}}
and {{y}}
.
Now, in the request URL, we will need to pass the ID of a Miro board under the team we authorized when we set up our authorization initially. If there aren’t any boards, simply create a new one from the Miro dashboard.
Hit Save and let’s populate these variables from some content outside of Postman.
Generate sticky notes from CSV file
To start, we’ll need a .csv file that we can work with. Let’s create a basic .csv file where the first line is our header, and the following lines are the content and coordinates that we will feed into our requests in Postman to create sticky notes via the Miro API.
Once we’ve got our .csv file set up, we can use the Postman Collection Runner to select the request we’ve already set up for the Create sticky note item endpoint and choose a number of iterations. We’ll do just a few iterations, and select the .csv file we created for the Data File Type. Hit Run Miro Developer Platform and go to the Miro board you specified in the Create sticky note item request earlier.
Voila! We can see our new stickies being generated from our .csv file as the Postman Collection Runner initiates.
While this is a simple example, you can imagine how many possibilities there are to combine the power of Postman and Miro to generate and manipulate content on a Miro board! But don't just take my word for it - you can take it even further.
Expand your workflow with Postman Flows and Miro
Interested in exploring further automation? Check out how we leveraged Postman Flows to add some more complexity to our variables and inputs in an effort to create even more dynamic workflows between Postman and Miro.
That's a wrap!
In addition to the capabilities we demonstrated here, there's so much more you can do with Postman and the Miro Developer Platform. Want to keep going? You can also build applications with Miro's Web SDK for a frontend experience directly on a Miro board, and use Miro's REST API for authorization and further automation.
This article was originally published on the Postman blog on August 18th, 2023.
Top comments (0)