Skip to main content

Microsoft Teams Component

Manage the teams, groups, channels, and messages associated with your Microsoft Teams account

Component key: ms-teams

Description

Microsoft Teams is a business communication platform developed by Microsoft, as part of the Microsoft 365 family of products. This component allows you to easily manage teams, groups, channels, and messages inside of your Microsoft Teams account.

Connections

This authentication method may be used when an App requires granting admin consent to API permissions, in addition to authorizing the integration with the App's configured client credentials.

The Microsoft Teams component authenticates requests through the Microsoft Graph API.

Creating an App Registration

To configure OAuth 2.0 you must first create an App through Active Directory in the Microsoft Entra Admin Center or Microsoft Azure Portal.

  1. Navigate to App Registrations
  2. When creating the application you will be prompted to select Supported account types.
  3. Select Accounts in any organizational directory (Any Azure AD directory - Multitenant).
  4. Navigate to Redirect URI and add the Web platform. Now enter the redirect URI as https://oauth2.prismatic.io/callback for US based integrations.
    1. For integrations outside the US refer to this guide to find your region’s Callback URL.
  5. Select Register to complete.
  6. In the App, navigate to Certificates & Secrets and select New client secret. Copy/save the Value for use in the connection configuration of your integration (the value will not be shown again).
  7. Next, navigate to the Overview section and copy the Application (client) ID
  8. Navigate to the API Permissions section to assign the proper permissions for the integration. Select Add Permission, select all permissions that are required for your desired integration and save these values for later. A full list of scopes can be found on the Microsoft Graph API documentation
    1. Recommended scopes for Teams can be found in Microsoft Graph > Application permissions: AppCatalog.Read.AllTeamsAppInstallation.Read.GroupTeamsAppInstallation.ReadWriteSelfForTeam.AllTeamsAppInstallation.ReadWriteForTeam.AllTeamsAppInstallation.ReadWriteAndConsentForTeam.AllTeamsAppInstallation.ReadWriteAndConsentSelfForTeam.AllGroup.ReadWrite.AllDirectory.ReadWrite.AllChannelSettings.Read.GroupChannel.ReadBasic.AllChannel.Delete.GroupChannel.Create.GroupChannelSettings.ReadWrite.GroupTeamwork.Migrate.AllChannelMessage.Read.GroupGroupMember.Read.AllTeam.ReadBasic.AllTeamMember.Read.GroupTeamMember.ReadWrite.AllTeamSettings.ReadWrite.GroupTeam.CreateTeamSettings.Read.GroupUser.Read.AllUser.ReadWrite.All

For more information regarding authenticating against the Microsoft Graph API refer to the Microsoft documentation.

Configuring the Integration

Supply the following values to the OAuth 2.0 Admin Consent Client Credentials connection in your integration within Prismatic:

  • Client ID enter the Application (client) ID
  • Client Secret enter the Value provided (Do not use Secret ID)
  • In the Admin Consent URL https://login.microsoftonline.com/{tenant}/adminconsent, replace {tenant} with the Directory (tenant) ID from the App.
  • In the Token URL https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token?grant_type=client_credentials, replace {tenant} with the Directory (tenant) ID from the App.
  • Provide the assigned API permissions as Scopes you assigned to your App. The default value will be set to https://graph.microsoft.com/.default which will use all admin consented permissions assigned to the App.
  • If you didn't select Multitenant when creating the App, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.

OAuth 2.0 Client Credentials

Begin by following the steps in Creating an App Registration.

When App is created, supply the following values to the OAuth 2.0 Client Credentials connection in your integration within Prismatic:

  • Client ID enter the Application (client) ID
  • Client Secret enter the Value provided (Do not use Secret ID)
  • If you didn't select Multitenant when creating the App, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.

OAuth 2.0 Authorization Code

Begin by following the steps in Creating an App Registration.

Recommended API permissions for Authorization Code Authentication:

  1. Navigate to the API Permissions section. Select Add Permission, select all permissions that are required for your desired integration. A full list of scopes can be found on the Microsoft Graph API documentation.
    1. Recommended scopes for Teams can be found in Microsoft Graph > Delegated permissions: Team.ReadBasic.AllTeam.CreateTeamMember.ReadWrite.AllChannelMessage.Read.Alloffline_access

When App is created, supply the following values to the OAuth 2.0 Authorization Code connection in your integration within Prismatic:

  • Client ID enter the Application (client) ID
  • Client Secret enter the Value provided (Do not use Secret ID)
  • Provide the Scopes you assigned to your Azure application permissions. The default value will match the recommended scopes. https://graph.microsoft.com/Team.ReadBasic.All https://graph.microsoft.com/Team.Create https://graph.microsoft.com/Group.ReadWrite.All https://graph.microsoft.com/TeamMember.ReadWrite.All https://graph.microsoft.com/ChannelMessage.Read.All offline_access
  • If you didn't select Multitenant when creating the App, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.

Incoming Webhook

Incoming Webhooks can be used for sending adaptive cards or plain text messages to individual chats or channels.

Triggers

Webhook

Receive and validate webhook requests from Microsoft Teams for webhooks you configure. | key: webhook

Output Example Payload

{
"response": {
"statusCode": 200,
"contentType": "application/json",
"body": "{ 'text': 'test' }"
},
"payload": {
"executionId": "123123123",
"instance": {
"id": "123",
"name": "Example Instance"
},
"invokeUrl": "https://hooks.example.com/trigger/asdfasdfasdf",
"pathFragment": "",
"headers": {
"accept": "*/*",
"Content-Type": "application/json",
"Host": "hooks.example.prismatic.io"
},
"body": {
"data": {}
},
"rawBody": {
"data": {
"type": "Buffer",
"data": [69, 120, 97, 109, 112, 108, 101]
}
},
"queryParameters": null,
"webhookUrls": {
"Flow 1": "https://hooks.example.prismatic.io/trigger/EXAMPLEGbG93Q29uZmlnOmRlNmNmNDMyLTliNWMtN0005NDMxLTRmYzA4ZjViODgxOA=="
},
"webhookApiKeys": {
"Flow 1": ["abc-123"]
},
"customer": {
"id": "123",
"externalId": "customer-example-external-id",
"name": "John Doe"
}
}
}

Data Sources

Channel Names

A picklist of channel names | key: channelNames | type: picklist


Team Names

A picklist of team names | key: teamNames | type: picklist


Actions

Add Team Member

Add a new member to the team | key: addMember

Output Example Payload

{
"data": {
"odata.type": "#microsoft.graph.aadUserConversationMember",
"id": "4e99g7eaf-68dd-43oT-ae3f",
"roles": [
"owner"
],
"displayName": "example",
"userId": "4e99g7eaf-68dd-43oT-ae3f",
"email": "someone@example.com",
"tenantId": "4e99g7eaf-68dd-43oT-ae3f"
}
}

Archive Team

Archive the specified team | key: archiveTeam


Create Channel

Create a channel inside a team | key: createChannel


Create Team

Create a new team | key: createTeam


Delete Channel

Delete the information and metadata of a given channel | key: deleteChannel


Delete User

Delete the information and metadata of an existing user | key: deleteUser

Output Example Payload

{
"data": {
"businessPhones": [
"+1 555 555 5555"
],
"displayName": "exampleUser",
"givenName": "exampleUser",
"jobTitle": "Retail Manager",
"mail": "someoneV@example.onmicrosoft.com",
"mobilePhone": "+1 555 555 5555",
"officeLocation": "example",
"preferredLanguage": "en-US",
"surname": "Example",
"id": "3693-4789-a1c3-f4de565f"
}
}

Get Channel

Retrieve the information and metadata of a given channel | key: getChannel


Get Current Or Existing User

Get the information and metadata of the current user or an existing user | key: getCurrentUser

Output Example Payload

{
"data": {
"businessPhones": [
"+1 555 555 5555"
],
"displayName": "exampleUser",
"givenName": "exampleUser",
"jobTitle": "Retail Manager",
"mail": "someoneV@example.onmicrosoft.com",
"mobilePhone": "+1 555 555 5555",
"officeLocation": "example",
"preferredLanguage": "en-US",
"surname": "Example",
"id": "3693-4789-a1c3-f4de565f"
}
}

Get Member

Get information or metadata about a team member | key: getMember

Output Example Payload

{
"data": {
"odata.type": "#microsoft.graph.aadUserConversationMember",
"id": "4e99g7eaf-68dd-43oT-ae3f",
"roles": [
"owner"
],
"displayName": "example",
"userId": "4e99g7eaf-68dd-43oT-ae3f",
"email": "someone@example.com",
"tenantId": "4e99g7eaf-68dd-43oT-ae3f"
}
}

Get Team

Get information or metadata of a team | key: getTeam


Get User

Get the information and metadata of an existing user | key: getUser

Output Example Payload

{
"data": {
"businessPhones": [
"+1 555 555 5555"
],
"displayName": "exampleUser",
"givenName": "exampleUser",
"jobTitle": "Retail Manager",
"mail": "someoneV@example.onmicrosoft.com",
"mobilePhone": "+1 555 555 5555",
"officeLocation": "example",
"preferredLanguage": "en-US",
"surname": "Example",
"id": "3693-4789-a1c3-f4de565f"
}
}

Install App

Add an Installed App to given team | key: addInstalledApp


List Catalog Apps

Retrieve the list of apps in the catalog | key: listCatalogApps


List Channel Messages

List all of the messages in a given channel | key: listChannelMessages

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('id')/channels('id')/messages",
"@odata.count": "1",
"value": [
{
"id": "6525322568857",
"replyToId": "665253225688577",
"etag": "111111",
"messageType": "message",
"createdDateTime": "2022-05-13T05:26:08.857Z",
"lastModifiedDateTime": "2022-05-13T05:26:08.857Z",
"lastEditedDateTime": "2022-05-13T05:26:08.857Z",
"deletedDateTime": "2022-05-13T05:26:08.857Z",
"subject": "example",
"summary": "example",
"chatId": "",
"importance": "normal",
"locale": "en-us",
"webUrl": "https://teams.microsoft.com/l/message/example",
"eventDetail": "",
"from": {
"application": "example",
"device": "example",
"user": {
"id": "6525322568857",
"displayName": "example",
"userIdentityType": "aadUser"
},
"body": {
"contentType": "text",
"content": "Hello World"
}
}
}
]
}
}

List Channels

Retrieve the list of channels in a given team | key: listChannels

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('id')/channels",
"@odata.count": "1",
"value": [
{
"id": "19:Qm7ZZyj4FQ-TZJMWDJYIKML19X",
"createdDateTime": "2022-05-11T05:24:49.127Z",
"displayName": "General",
"isFavoriteByDefault": false,
"email": "someone@example.com",
"webUrl": "https://teams.microsoft.com/l/channel/example-id",
"membershipType": "standard"
}
]
}
}

List Installed Apps

Retrieve the list of installed apps in a given team | key: listInstalledApps


List Joined Teams

List the teams you have joined | key: listJoinedTeams

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams",
"@odata.count": 1,
"value": [
{
"id": "aa6fsa5ae-ed8e-4af1-aefs4-bce66f795ea5",
"createdDateTime": "",
"displayName": "Example Team",
"description": "Example Description",
"internalId": "aa6fsa5ae-ed8e-aefs4-bce66f795ea5",
"summary": "Example Summary"
}
]
}
}

List Team Members

List all the members in a team | key: listMembers

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('id')/members",
"@odata.count": 1,
"value": [
{
"odata.type": "#microsoft.graph.aadUserConversationMember",
"id": "4e99g7eaf-68dd-43oT-ae3f",
"roles": [
"owner"
],
"displayName": "example",
"userId": "4e99g7eaf-68dd-43oT-ae3f",
"email": "someone@example.com",
"tenantId": "4e99g7eaf-68dd-43oT-ae3f"
}
]
}
}

List Teams

List all teams | key: listTeams

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams",
"@odata.count": 1,
"value": [
{
"id": "aa6fsa5ae-ed8e-4af1-aefs4-bce66f795ea5",
"createdDateTime": "",
"displayName": "Example Team",
"description": "Example Description",
"internalId": "aa6fsa5ae-ed8e-aefs4-bce66f795ea5",
"summary": "Example Summary"
}
]
}
}

List Teams Apps

List apps from the Microsoft Teams app catalog | key: listTeamsApps


List User's Teams

List all teams containing the provided user | key: listUsersTeams


List Users

List all users | key: listUsers

Output Example Payload

{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"value": [
{
"businessPhones": [
"+1 555 555 5555"
],
"displayName": "exampleUser",
"givenName": "exampleUser",
"jobTitle": "Retail Manager",
"mail": "someoneV@example.onmicrosoft.com",
"mobilePhone": "+1 555 555 5555",
"officeLocation": "example",
"preferredLanguage": "en-US",
"surname": "Example",
"id": "3693-4789-a1c3-f4de565f"
}
]
}
}

Raw Request

Send raw HTTP request to Microsoft Teams | key: rawRequest


Remove Installed App

Remove an Installed App from the given team | key: removeInstalledApp


Remove Team Member

Remove a user from a provided team | key: removeMember


Send Adaptive Card To Channel

Send an adaptive card message to a given channel | key: sendChannelAdaptiveCard


Send Incoming Webhook Adaptive Card

Send an adaptive card message to an Incoming Webhook | key: sendIncomingWebhookAdaptiveCard

This action must use the "Incoming Webhook" connection type.

See adaptivecards.io for documentation on constructing card payloads.


Send Incoming Webhook Message

Send a text message to an Incoming Webhook | key: sendIncomingWebhookMessage

This action must use the "Incoming Webhook" connection type.


Send Message To Channel

Send a message to a given channel | key: sendChannelMessage


Update Channel

Update an existing channel inside a team | key: updateChannel


Update Team

Update an existing team | key: updateTeam


Upgrade Installed App

Upgrade an Installed App to the latest version for given team | key: upgradeInstalledApp