Access team name in SDK?

  • 19 September 2023
  • 6 replies
  • 55 views

Badge +1

Is there a way to read the team name through the SDK? Or do i have to make a backend REST call to fetch the team name? (One problem i see with this approach is that the Team API is only available on the Enterprise plan - which makes sense for more complex team integrations like sync etc, but for just reading the team name its a bit overkill.)


6 replies

Userlevel 6
Badge +4

Hi @Atle,

Good question, you have a couple of options. First, you can call the GET Board/GET Boards endpoints, which return the team ID and team name associated with a board. This would be the most straightforward way, and these endpoints don’t require an Enterprise plan. 

If you’d like to use the Web SDK, you can also try leveraging the getIdToken method: https://developers.miro.com/docs/board_board#getidtoken

This generates a secure token that represents the current user’s session, and can be JWT decoded to reveal the team_id. However, if you need the team name, you would still need to call the API to get this detail.

It’s a great suggestion however — it would be great to make this detail more accessible through the SDK. I’ve gone ahead and shared this feedback with our team!

Badge

Is there a way to read the team name through the SDK? Or do i have to make a backend REST call to fetch the team name? (One problem i see advancedcardetailing with this approach is that the Team API is only available on the Enterprise plan - which makes sense for more complex team integrations like sync etc, but for just reading the team name its a bit overkill.)

If the team name is configured by the user within your application, consider storing this information locally (e.g., in a configuration file, local database, or local storage) after the user provides the team name. The application can then read this stored information without needing to make a network call.

 

Badge +1

Is there a way to read the team name through the SDK? Or do i have to make a backend REST call to fetch the team name? (One problem i see advancedcardetailing with this approach is that the Team API is only available on the Enterprise plan - which makes sense for more complex team integrations like sync etc, but for just reading the team name its a bit overkill.)

If the team name is configured by the user within your application, consider storing this information locally (e.g., in a configuration file, local database, or local storage) after the user provides the team name. The application can then read this stored information without needing to make a network call.

 

Thanks for the suggestion. I want to access the Miro team name though so its easier for users to track resource usage of backendservices which are provisioned per Miro team. 

Badge +1

Hi @Atle,

Good question, you have a couple of options. First, you can call the GET Board/GET Boards endpoints, which return the team ID and team name associated with a board. This would be the most straightforward way, and these endpoints don’t require an Enterprise plan. 

If you’d like to use the Web SDK, you can also try leveraging the getIdToken method: https://developers.miro.com/docs/board_board#getidtoken

This generates a secure token that represents the current user’s session, and can be JWT decoded to reveal the team_id. However, if you need the team name, you would still need to call the API to get this detail.

It’s a great suggestion however — it would be great to make this detail more accessible through the SDK. I’ve gone ahead and shared this feedback with our team!

Thank you.

This probably means that we must implements the OIDC flow to get an access token to be able to access the API, correct?

Or can we use some trick to get a token with the help of the app secret?

We would like to be able to access the board on behalf of the app, not the user who is loggen on.

Userlevel 6
Badge +4

Hey, @Atle!

This probably means that we must implements the OIDC flow to get an access token to be able to access the API, correct?

Or can we use some trick to get a token with the help of the app secret?

 

That’s right — you will need to generate an access token in order to call our REST API. You can do this in one of two ways:

  1. Generate an access token from the Miro App Settings page in the UI, when you install/authorize your app under a given team:
    1.  

  2. Do this programmatically, following our OAuth2.0 flow.

 

I hope it helps!
Will

Badge

Is there a way to read the team name through the SDK? Or do i have to make a backend REST call to fetch the team name? (One problem i see Signature Detailerswith this approach is that the Team API is only available on the Enterprise plan - which makes sense for more complex team integrations like sync etc, but for just reading the team name its a bit overkill.)

If the team name is configured by the user within your application, consider storing this information locally (e.g., in a configuration file, local database, or local storage) after the user provides the team name. The application can then read this stored information without needing to make a network call.

 

Great point, When configuring the team name within your application opting for a local storage solution is a smart move. Storing this information locally whether it is in a configuration file, local database, or local storage, ensures that the application can access it seamlessly without the need for frequent network calls. This not only improves performance but also contributes to a more user-friendly experience.

In summary, the key is to empower users to set their team names and have the application store this data locally. This approach enhances efficiency and responsiveness while keeping the user in control..

Reply