How do I translate an internal team id to team group id?

Jacob Linney 11 Reputation points
2022-10-20T16:35:26.41+00:00

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?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,085 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,000 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jacob Linney 11 Reputation points
    2022-10-21T17:27:27.257+00:00

    Found the answer: TeamsInfo.getTeamChannels(turnContext); will yield an object with

       {  
        "id": "<internal-id>",  
       "aadGroupId": "<team-guid>"  
       }  
    
    2 people found this answer helpful.
    0 comments No comments

  2. Shivam Dhiman 6,056 Reputation points
    2022-10-20T22:53:32.687+00:00

    Hi @Jacob Linney

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.