Let us see how to work with Microsoft teams from SharePoint programmatically using Graph APIs.
Microsoft has provided the Graph APIs to work with Microsoft Teams and its channels. Though, it is in a beta version. The graph APIs can be triggered from any of the portals. Here, let us only look at triggering the graph APIs from the SharePoint portals.
For example, the following graph API is used to get all the teams which you are part of.
Application with Microsoft Teams Permissions
First, you need to register the application in Microsoft dev portal, where you need to provide the necessary permissions for accessing the Microsoft Teams data from any portal.
Login to the Microsoft applications portal https://apps.dev.microsoft.com
Provide the name
Copy the Application ID generated. (It will be used as client ID in the SharePoint code in the below section)