Hello, I am at the beginning of development project to populate Miro board using API.
Checking API reference at https://developers.miro.com/reference I can’t find enough details for what I need.
My requirements are:
For a board <xxx>
Create/update card widgets
I found Get Current User Boards API which returns all boards current user has access to. I can then loop through to find the board I need and start adding/updating cards.
Card widget JSON does have tags field. Is there any way to add tags via API?
Are there any examples of end-to-end similar functionality (including authentication)?
Best answer by Anthony RouxView original
Your flow seems to be the right one. This is one way to do it:
I don’t think we have a code sample for this exactly, you can take a look at this example showing how to implement the OAuth2 flow.
If I had to summarise it:
For the OAuth 2.0 flow:
Step 0 - Create a Dev Team and an Application
Step 1 - Create the authorization link and send it to the user
Step 2 - Get the verification code (as a query parameter)
Step 3 - Use the verification to obtain an access token
Step 4 - Make an API call musing the access token
You need to add an authorization serverto which you will redirect your users. This will be the server to which the user will be redirected to when authorizing the access. In the example here I use localhost:3000, you will need to set that up into your profile in the Redirect URI field.
Prepare the URL by updating the redirect_uri and your client id (replace the XXX) (that you get in your profile)
If you open this link into a browser you will have the popup to authorize your app (this is what you should give to your users into your app). If you authorize it, it will redirect you to the redirect_uri (localhost in the example). If you try with localhost without having a server running you will get an error but if you take a look at the URL you will see a new query parameter "code". You need to save that code to exchange it for an access token. Please note that this code has a time to live of 10min and can be used only one time.
The API Response of this API call will contain your access token:
To call Miro’s API, you will need to add this access token in the header of the API requests:
And you are good to go!
As of today, we do not provide a REST API to create tags.