Microsoft Teams Component
Manage the teams, groups, channels, and messages associated with your Microsoft Teams account
Component key: ms-teamsDescription
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
OAuth 2.0 Client Credentials
OAuth 2.0 Authorization Code
The Microsoft Teams component authenticates requests through the Microsoft Graph API. To configure OAuth 2.0 you must first create an application through Active Directory in the Microsoft Azure Portal.
When creating the application you will be prompted to select the 'Supported account types'. Under this section, be sure to select 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)'. You will need to go to "Platforms" and add the "Web" platform. In that section you should add Prismatic's OAuth 2.0 callback URL - https://oauth2.prismatic.io/callback - as a Redirect URI.
Next, go to "Certificates & Secrets" for the app and add a new Client Secret. Note this value as you will need to supply it to the connection within Prismatic.
You will also need the Application (client) ID from the "Overview" page.
The last step of configuring the "App Registration" is assigning "App Permissions". Click "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
Next, supply the following values to the OAuth 2.0 connection in your integration within Prismatic:
- For Client ID and Client Secret enter the values that you got from the Microsoft Azure Portal.
- Provide the Scopes you assigned to your Azure application permissions.
- If you didn't select Multitenant when creating the Azure application, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.
For more information regarding authenticating against the Microsoft Graph API refer to the Microsoft documentation.
Incoming Webhook
Incoming Webhooks can be used for sending adaptive cards or plain text messages to individual chats or channels.
Triggers
Webhook
Trigger for handling outgoing webhooks from Microsoft Teams | 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 User
Get the information and metadata of the user that is currently logged in | 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 a raw HTTP request to Microsoft Teams API | 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