Answered

Move an object up or down in layers - API

  • 27 November 2020
  • 1 reply
  • 1557 views

Forgive me if something is not entirely clear, I am a Russian-speaking user.

I want to know how can I implement a method to move an object up or down in layers?
It's quite easy to do it on the board - just select an object, press the ellipsis - brintg to front or Sent to back.
How can this be done through the API?
Unfortunately I am not at all familiar with API Miro, but I have experience in this area, so I think I can get an authentication token and connect to my board. What's next?
Can you provide links to the required documentation? (I work in Python)

Thanks.

icon

Best answer by Daniela Gavidia 1 December 2020, 10:45

View original

1 reply

Userlevel 4
Badge

Hello,

 

The Miro SDK includes methods to move a widget forward and send it backwards, just like you do it on the board. From our SDK documentation:

https://developers.miro.com/docs/interface-iboardwidgetscommands#section-bring-forward
https://developers.miro.com/docs/interface-iboardwidgetscommands#section-send-backward

 

You can try it on the Javascript browser console. First, obtain the id of the widget you want to move. Then call:
await miro.board.widgets.bringForward(<WIDGET_ID_HERE>)

or

await miro.board.widgets.sendBackward(<WIDGET_ID_HERE>)

 

I hope this helps.

 

Kind regards.

 

Daniela

Reply