The Microsoft Teams Admin API allows you to manage Teams environments programmatically. With it, you can automate tasks like creating and managing teams, channels, and policies, as well as controlling membership and settings. Leveraging Pipedream's serverless execution model, you can create workflows that react to specific triggers and perform a sequence of actions across multiple services, enhancing your organization's productivity and governance within Microsoft Teams.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
microsoft_teams_admin: {
type: "app",
app: "microsoft_teams_admin",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://graph.microsoft.com/v1.0/me`,
headers: {
Authorization: `Bearer ${this.microsoft_teams_admin.$auth.oauth_access_token}`,
},
})
},
})
Automated Team Provisioning: When a new employee is onboarded and added to your HR system, a Pipedream workflow can be triggered to create a new team in Microsoft Teams, complete with predefined channels and settings, ensuring they have the resources they need from day one.
Policy Compliance Monitoring: Set up a Pipedream workflow to regularly audit team settings and memberships against compliance policies. If it detects a policy violation, such as a public team containing sensitive information, the workflow can automatically revert changes and notify administrators.
Cross-Platform Collaboration: Integrate Microsoft Teams Admin with Slack using Pipedream. Whenever a new Slack channel is created in your company's workspace, a corresponding team or channel can be created in Teams, ensuring cross-platform collaboration is streamlined and no team is siloed.
Microsoft Teams Admin uses OAuth authentication. When you connect your Microsoft Teams Admin account, Pipedream will open a popup window where you can sign into Microsoft Teams Admin and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Microsoft Teams Admin API.
Pipedream requests the following authorization scopes when you connect your account:
User.Read
email
offline_access
openid
profile
Chat.Read
Chat.ReadWrite
ChatMessage.Send
Channel.Create
Channel.ReadBasic.All
Chat.ReadWrite.All
Directory.Read.All
ChannelMessage.Read.All
ChannelMessage.Send
TeamMember.Read.All
TeamworkDevice.Read.All
GET
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://login.microsoftonline.com/common/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
scope={{oauth.space_separated_scopes}}
POST
https://login.microsoftonline.com/common/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}