DevÁsith
DevÁsith

Reputation: 1234

How to Retrieve User Joined Teams in Microsoft Teams JavaScript Library

I'm trying to work with the Microsoft Teams JavaScript Library, and I've noticed in the documentation that there's a callback called teams.fullTrust.joinedTeams.getUserJoinedTeams for retrieving user joined teams.

https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/using-teams-client-library?tabs=javascript%2Cmanifest-teams-toolkit#callbacks-converted-to-promises

However, when I inspected context.teams in the Teams JavaScript library, I couldn't find a built-in function to retrieve user joined teams. Is there a built-in function or an alternative approach to achieve this?

Upvotes: 0

Views: 125

Answers (1)

SaiPratap-MSFT
SaiPratap-MSFT

Reputation: 69

you can achieve this by using the Microsoft Graph API. Microsoft Graph API provides two HTTP GET methods to retrieve the teams that a user is a part of:

GET /me/joinedTeams
GET /users/{id | user-principal-name}/joinedTeams

These methods return a list of team resources that the user is a part of

Upvotes: 0

Related Questions