Microsoft Teams

Send messages, create channels, and collaborate in Microsoft Teams.

CommunicationOAuth14 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (14)
  4. microsoft_teams_create_channel
  5. microsoft_teams_create_chat_and_send_message
  6. custom_api_call
  7. microsoft_teams_create_private_channel
  8. microsoft_teams_delete_chat_message
  9. microsoft_teams_find_channel
  10. microsoft_teams_find_team_member
  11. microsoft_teams_get_channel_message
  12. microsoft_teams_get_chat_message
  13. microsoft_teams_reply_to_channel_message
  14. microsoft_teams_send_channel_message
  15. microsoft_teams_send_chat_message
  16. request_approval_direct_message
  17. request_approval_in_channel
  18. Details

Connect

Auth type: OAuth (oauth2). The connection holds the provider's OAuth tokens. They are sealed on the server and only opened when an action runs.

Scopes requested: Chat.ReadWriteChannelMessage.SendUser.Read

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("microsoft_teams", action, input) resolves with the provider's answer and rejects when Microsoft Teams isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "microsoft_teams"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Microsoft Teams when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellMicrosoftTeams = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Microsoft Teams isn't connected.
  const output = await step.run("Microsoft Teams", () =>
    step.ctx.integrations.invoke("microsoft_teams", "microsoft_teams_create_channel", {
      "teamId": "<teamId>",
      "channelDisplayName": "<channel name>"
    }),
  );
  step.ctx.log("Microsoft Teams answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "microsoft_teams",
    "piece_action": "microsoft_teams_create_channel",
    "input": {
      "teamId": "<teamId>",
      "channelDisplayName": "<channel name>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/microsoft_teams/microsoft_teams_create_channel" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"teamId":"<teamId>","channelDisplayName":"<channel name>"}}'

Actions

microsoft_teams_create_channel

Create Channel. Create a new channel in Microsoft Teams.

Also accepted as create_channel.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelDisplayNamerequiredtextChannel Name
channelDescriptionoptionallong textChannel Description

microsoft_teams_create_chat_and_send_message

Create Chat & Send Message. Start a new chat and send an initial message.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
membersrequiredids (picked from your account)Member
contentTyperequiredone of "text" | "html"Message Content Type
contentrequiredlong textInitial Message

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

microsoft_teams_create_private_channel

Create Private Channel. Create a new private channel in a team.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelDisplayNamerequiredtextChannel Name
channelDescriptionoptionallong textChannel Description

microsoft_teams_delete_chat_message

Delete Chat Message. Soft-Deletes a message in chat.You can only delete messages you sent.

InputTypeDescription
chatIdrequiredid (picked from your account)Chat ID
messageIdrequiredtextThe ID of the message to delete.

microsoft_teams_find_channel

Find Channel. Finds channels by name.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelNamerequiredtextChannel Name

microsoft_teams_find_team_member

Find Team Member. Finds a team member by email or display name.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
searchByrequiredone of "email" | "name"Search By
searchValuerequiredtextEmail address or name to search for.

microsoft_teams_get_channel_message

Get Channel Message. Fetch a specific channel message by team, channel, and message ID (optionally a reply).

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelIdrequiredid (picked from your account)Channel ID
messageIdrequiredtextThe ID of the channel message to retrieve.
replyIdoptionaltextProvide to fetch a specific reply under the message.

microsoft_teams_get_chat_message

Get Chat Message. Fetch a specific chat message by chat and message ID.

InputTypeDescription
chatIdrequiredid (picked from your account)Chat ID
messageIdrequiredtextThe ID of the message to retrieve.

microsoft_teams_reply_to_channel_message

Reply to Channel Message. Post a reply to an existing channel message.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelIdrequiredid (picked from your account)Channel ID
messageIdrequiredtextID of the parent message to reply to.
contentTyperequiredone of "text" | "html"Content Type
contentrequiredlong textMessage

microsoft_teams_send_channel_message

Send Channel Message. Sends a message to a teams's channel.

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelIdrequiredid (picked from your account)Channel ID
contentTyperequiredone of "text" | "html"Content Type
contentrequiredlong textUse @username to mention team members in the message.

microsoft_teams_send_chat_message

Send Chat Message. Sends a message in an existing chat.

InputTypeDescription
chatIdrequiredid (picked from your account)Chat ID
contentTyperequiredone of "text" | "html"Content Type
contentrequiredlong textMessage

request_approval_direct_message

Request Approval from a User. Send approval message to a user and then wait until the message is approved or disapproved

InputTypeDescription
chatIdrequiredid (picked from your account)Chat ID
messagerequiredlong textMessage

request_approval_in_channel

Request Approval in Channel. Send approval message to a channel and then wait until the message is approved or disapproved

InputTypeDescription
teamIdrequiredid (picked from your account)Team ID
channelIdrequiredid (picked from your account)Channel ID
messagerequiredlong textMessage

Details

Id
microsoft_teams
Category
Communication
Tags
chat, team, microsoft, enterprise
Package
@activepieces/piece-microsoft-teams@0.3.13
Runs
Through the integration runner