Is it possible to use window.location.pathname to get Miro board path while using REST API?

  • 29 October 2020
  • 1 reply

Userlevel 2
Badge +3


I’m using Miro REST API in the form of a sidebar, I’m trying to export data to a external database and would like to mark each dataset with its corresponding miro board ID from the board url like this one for example: https://miro. com/app/board/hereistheboardid/

I’m trying to do this by calling window.location.pathname.split('/') from which I then obtain an array of paths in the link. Unfortunately the paths that I get returned back are ones from my server where I keep the code to my miro REST API  

Outlined in blue is my sidebar, from which the url path gets returned, but in the red there is underlined the actual window url / location which I believe it should return. Any ideas how to get the miro board URL via my REST API / webplugin?


Best answer by Daniela Gavidia 3 November 2020, 11:29

View original

1 reply

Userlevel 4

Hello Sami,


If you want to get the id of the Miro board, you could use the SDK. The board object provides information about the current board. You would call it like this:



My Board Info

Calling returns a promise that resolves to a BoardInfo object:


You can get only the board id like this:


I hope this helps.


Kind regards.