I have a requirement to fetch the list of teams a user is a part of
Please help on how I can achieve this?
There isn’t an endpoint that does this for you, but you are able to get a list of teams in an organization, and then search the teams for their members, and filter out your user from there
Please keep in mind, that these APIs require an active enterprise plan in order to work.
Hi @Addison Schultz
The response of this does not have team members in it. Is there any other alternative?
@HarshitaVishwakarma Is organization using the enterprise plan?
Yes. I am able to list the teams, and get the team by it’s id but the response does not have team members in it.
After you get the teamId, you will then need to call this endpoint to get users of that team: https://developers.miro.com/reference/getmembers
Got it. But unfortunately there is a limit of returning only 100 teams in the list teams API whereas I am dealing with 100+ teams. Is there any way to overcome this?
On a side-note the solution you provided looks good but seems like it will take a lot of looping and iterations to achieve it, especially when the data is huge. What are your thoughts on this?
You can set one of the parameters that should return more than 100 teams. Regarding the looping over data - this is the recommend way you should approach this
Okay thanks. And I tried setting the limit to 200 but I get back this error:
"message": "org.springframework.validation.BeanPropertyBindingResult: 1 errors\nField error in object 'teamsCursorQuery' on field 'limit': rejected value ; codes [Max.teamsCursorQuery.limit,Max.limit,Max.int,Max]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [teamsCursorQuery.limit,limit]; arguments ; default message [limit],100]; default message [limit value should be less than 100]",
Seems like the docs don’t mention that 100 is the max limit.
Thanks for reporting - this is a bug in our docs, I’ll pass it over to our team. That being said, are you able to use the cursor parameter to find the next item(s) in the iteration?
No problem. I tried the cursor parameter and it works. Just so my understanding isn’t wrong, so adding the cursor like this:
https://api.miro.com/v2/orgs/<org_id>/teams?limit=100&cursor=<100th team’s ID>
will return the next 100 teams based on the 100th team’s id and so on, correct?
P.S: There’s another bug in the docs for this API
Should be: https://api.miro.com/v1/oauth-token
Currently it is: https://api.miro.com/v1/v1/oauth-token
Yes, that is correct!
Great! Thanks so much for your help. I really appreciate it 🙂
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.