Found the answer: TeamsInfo.getTeamChannels(turnContext);
will yield an object with
{
"id": "<internal-id>",
"aadGroupId": "<team-guid>"
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I'm working on building an application with the botbuilder framework and the microsoft graph API. I would like to be able to call the https://graph.microsoft.com/beta/teams/{group-id}
set of endpoints when a user makes a request through my bot. However, I cannot find a way to get that group ID.
Using the TurnContext
, I can get the internal team id via context.activity.channelData.team.id
, but I cannot use this for the graph API as it is in the format of 19:***@thread.tacv2
instead of a GUID. How do I translate this to the teams GUID?
Found the answer: TeamsInfo.getTeamChannels(turnContext);
will yield an object with
{
"id": "<internal-id>",
"aadGroupId": "<team-guid>"
}
The "19:***@thread.tacv2" Id which you are getting is channel Id.
To get the teams in Microsoft Teams that the user is a direct member of you can use GET https://graph.microsoft.com/v1.0/me/joinedTeams this Graph API. This API will give you ID of all teams that user is member of.
Reference
If you want to list all the groups available in an organization, use GET https://graph.microsoft.com/v1.0/groups this Graph API endpoint.
Reference
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.