How To Fetch The Teams ID And Channel ID For Microsoft Teams

Introduction

 
Microsoft graph is gaining popularity day by day to get data from Microsoft 365 platforms. One of the most important applications of this is Microsoft Teams. It has already disrupted the market with its daily active users. If we want to use graph api for Microsoft Teams we need Team Id and Channel Id. This is one of the common things which would be required. In this blog we will understand how we can easily acquire both the id using Web based application or native application.
 
Fetch Teams and Channel Id using Teams Web-based application or native application.
 
To fetch the teams and channel id we will need to either login to https://teams.microsoft.com/ or open our teams native application.
 

Fetch Team ID 

  • Navigate to the team for which we require the id
  • Click on the (...) three dots present on the right side of the team name
  • From the flyout menu as displayed in the image below click on Get link to team
  • A popup with the link would appear and in this link the value of group id is the teams Id which can be used in graph API as mentioned below
 

Fetch Channel ID

 
To fetch the channel ID using the UI we need to follow the same process as mentioned above but we will get the channel id from the link after the path /channel from the link.
  • Navigate to the channel for which we require the id
  • Click on the (...) three dots present on the right side of the channel name
  • From the flyout menu as displayed in the image below click on Get link to channel
  • A popup with the link would appear with the channel id mentioned after the path /channel as mentioned in the image below
 

Conclusion

 
To use Graph API we need Team id and channel id. This can be acquired in multiple ways but if we need it for a specific team and channel it is very easy to fetch it from the Microsoft Team Web based application or native application.