BoardsPicker for anonymous users: get accessToken to use with Rest API?

  • 12 February 2021
  • 4 replies
  • 97 views

Badge +1

Hello,

When a Board is created using boardsPicker with 

{
allowCreateAnonymousBoards: true,
action: "access-link"
}

… is there a way to obtain an accessToken to use with the REST API, to modify this anonymous Board?

(Assuming the user is not logged into Miro, and is therefore created as a Guest Editor.)

 

I imagine that if the user were logged in to Miro already, we would need to complete an OAuth2 flow to obtain permission to use and accessToken on their behalf. However if the user is anonymous, then presumably there is no downside to also returning a REST API accessToken along with the accessLink?

 

My use case: allow unregistered users to create a Board, and then to programatically populate it with some content, and later to programatically read some content from it.

 

I will also investigate another approach: programatically creating Boards within my own Team, and generating public editor links for those, and then using Live Embed to enable unregistered users to use them. However the boardPicker approach seems preferable at first look.

 

Many thanks.


4 replies

Userlevel 4
Badge +8

Hey @sndyrgrs !

My use case: allow unregistered users to create a Board, and then to programatically populate it with some content, and later to programatically read some content from it.

 

Unfortunately right now we do not support such use cases,  but plan to support it in the future.

Could you please clarify what kind of content is it (dynamic data? static template? both combined?) that you want to write and read?

Thank you.

Badge +1

Hey @Boris Borodyansky , thanks for the reply.

Unfortunately right now we do not support such use cases,  but plan to support it in the future.

Understood - thank you. Hopefully if & when this does become available we can make use of Miro integrations!

 

Could you please clarify what kind of content is it (dynamic data? static template? both combined?) that you want to write and read?

The optimal scenario would be to read/write dynamic data (so that there can be a sort of interaction between the board state and some triggers/watchers within our app. E.g. to let users manipulate the board following some instructions, and then some trigger would happen in our app (e.g. a button press, or a cron job would change the state from a “pre-meeting” arrangement to an “in-meeting” arrangement at the start of an event). 

A simpler but adequate scenario would be to initialise (or duplicate) a template board, and for users to follow instructions in that template, and finally drop some outputs (say, stickies or text widgets) into a predefined frame – and then use the REST API to read those outputs and process them within our app.

 

Slightly off-topic: I did try a different approach, of making a board using the REST API authenticated by myself as a user, setting the board state to allow anonymous guest editors, using the REST API to place some template widgets onto the board, and then embedding the board on a user screen. So our app would sort of act as an automatic workshop host. I imagine this is not an intended workflow in production, given your pricing models etc? I stopped exploring this approach because the REST API seems to discourage putting the board into a state of allowing Anonymous Guests Editors (the privacy option of “moderate” seems to basically be this but is undocumented). I also found that, if I had a hand-created “template” board, that when I listed the widgets on it via REST, I could not send the same JSON back as create operation on a new board (because only some widgets are supported for Create operations, and various things like padding attributes and color hex code enums seem to be different between the interface (choices I can make as a user) and the API (choices allowed via create operation).

 

I hope that is helpful context for our use case! Thanks.

Badge +2

Your use of the rest API is my ideal use-case. Were you able to get this working smoothly? Boardspicker is great but it doesn’t allow for populating via API and it doesn’t offer the export to PDF feature. Did you receive any reply about this use case and its acceptability?

Badge +1

Your use of the rest API is my ideal use-case. Were you able to get this working smoothly? 

@Gal Ben-Chanoch I’m afraid I didn’t get this working smoothly enough for production, no. In the end we implemented a largely-custom solution (many fewer features of course – drag-and-drop board built on top of https://github.com/atlassian/react-beautiful-dnd).

I did get a Miro proof-of-concept working by making a board using the API and using some hand-crafted JSON to place templated objects (some titles and stickies) on the board, then setting the sharing setting to “moderate” on the board. Since this is mostly undocumented and seems pretty API-unstable, I wouldn’t recommend doing this unless (a) it’s just a toy project you don’t mind breaking or (b) Miro announce some more official support for these APIs (probably with a pricing plan to match).

Did you receive any reply about this use case and its acceptability?

I didn’t get any other relevant reply from Miro support folks by other channels, so no secrets to share I’m afraid :) 

Reply