Microsoft Teams
Integrate Microsoft Teams with Courier by creating a Teams app and bot, configuring scopes, installing it in Teams, linking it in Courier using your Bot ID and password, and optionally enhancing notifications using Adaptive Cards, profile-based targeting, and overrides.
Create and Configure a Microsoft Teams App
Step 1: Create a Microsoft Teams App
- Open the Microsoft Teams Developer Portal.
- In the sidebar, navigate to Apps.
- Click New app.
- Enter a name for your app and click Add.
We recommend adding -app
to your app name to differentiate it clearly from your bot, especially if you manage multiple bots or apps.
- Save your App ID and App Password—you’ll need these later.
- Navigate to Configure > Basic Information.
- Complete the required fields (e.g., App ID, App Name).
- Click Save.
Step 2: Add Bot Functionality to the App
To send notifications via Courier, your Microsoft Teams app requires a bot. You can use an existing bot or create a new one.
- In the sidebar of the Microsoft Teams Developer Portal, select Configure > App Features.
- Click Bot to add bot functionality.
- If you already have a bot, select it and skip to step 9. Otherwise, click Create a new bot to open the Bot Management Tool.
- In the Bot Management Tool, click + New Bot and provide a unique name.
Use a distinct name for your bot to avoid confusion with your app.
- Select your bot in the Bot Management Tool.
- Under Client Secrets, create and securely store a new client secret.
- Return to the Microsoft Teams Developer Portal and select your app.
- In Configure > App Features, click Bot again.
- Select your bot from the dropdown.
- Configure bot scopes:
- Under What can your bot do?, select:
- ✓ Only send notifications (one-way conversations)
- Under Select the scopes where people can use your bot, select:
- ✓ Personal (for 1:1 notifications)
- ✓ Team (for channel notifications)
- ✓ Group Chat (for group chat notifications)
- Under What can your bot do?, select:
- Click Save.
Step 3: Install the App in Teams
After configuring your app and bot, install the app in Microsoft Teams. There are two primary ways to install:
For direct 1:1 notifications, users must either:
- Start a chat with the bot.
- Be @mentioned by the bot in a channel where it’s installed.
- Have the app pre-installed by an admin for individual use.
Clicking Add alone makes the app available but does not install the bot across teams or chats. Always use the dropdown menu to specify the correct installation context, typically choosing Add to a Team for notifications.
Ensure you save your generated password securely. Keep the Messaging endpoint blank for now.
Step 4: Configure Microsoft Teams Integration in Courier
Now that your Microsoft Teams app is ready, configure it in Courier:
In Courier, navigate to Integrations > Microsoft Teams. Enter your Bot ID
and Bot Password
, then click Install Provider.
Courier’s integration requires the Bot ID and Bot Password. You can find your Bot ID at:
- Microsoft Teams Developer Portal > Tools > Bot Management: “Bot ID”
- Microsoft Bot Framework > [Bot Name] > Settings: “Bot handle”
- Azure Portal App Registration > All Applications > [Bot Name]: “Application (client) ID”
- Microsoft Entra Admin Center: “Application (client) ID”
Congratulations! You’ve successfully created a Microsoft Teams Bot and configured it in Courier. You can now send notifications to Microsoft Teams channels and users.
Courier → Recipient Flowchart
Profile Requirements
To send notifications to Microsoft Teams, Courier requires the recipient’s user profile to include an ms_teams
object. This object must contain the following fields:
tenant_id
: Your Microsoft Teams tenant ID.service_url
: The service URL for your region (e.g.,https://smba.trafficmanager.net/amer
).- One of the following identifiers:
user_id
email
conversation_id
- Combination of
team_id
andchannel_name
To find your tenant_id
, navigate to https://teams.microsoft.com/?tenantId
and copy the tenantId
query parameter from the redirected URL. If the parameter isn’t visible, click the three-dot menu next to your Team, select Get link to team, and locate the tenantId
in the URL.
For users in the Americas region, the standard service URL is https://smba.trafficmanager.net/amer
.
To send messages using either email
or channel_name
, your bot must have the following Microsoft Graph API permissions:
ChannelSettings.Read.All
(requires admin consent)TeamSettings.Read.All
(requires admin consent)User.Read.All
These permissions allow Courier to resolve the user_id
or channel_id
using the Microsoft Graph API.
Overrides
Overrides allow you to change the Azure Bot’s App ID and App Password directly within your Courier message payload:
Adaptive Cards
Courier supports Microsoft Teams Adaptive Cards through Jsonnet blocks within the Template Designer. Adaptive Cards let you create interactive, visually appealing notifications for your users in Microsoft Teams.
Using Jsonnet Blocks
Jsonnet blocks enable you to customize the appearance and functionality of Adaptive Cards sent through Microsoft Teams. Follow the steps below to create and send your first Adaptive Card:
- In Courier’s Template Designer, add a new Microsoft Teams channel.
- Insert a Jsonnet block within your message.
Jsonnet Block
- Open the Adaptive Cards Designer and select or create a card layout.
- Copy the card JSON from the “Card Payload Editor” into your Courier Jsonnet block.
Sample Jsonnet
Sending an Adaptive Card
When sending your Adaptive Card, ensure your Courier message includes the necessary sample data from the Adaptive Cards Designer:
Ensure your recipient profile includes a valid ms_teams
object with the appropriate fields (e.g., conversation_id
). Once sent, your Adaptive Card will appear in Microsoft Teams:
MS Teams Adaptive Card
Congratulations, you’ve successfully sent an Adaptive Card through Courier!
Using @Mentions in Adaptive Cards
To include mentions in Adaptive Cards, you’ll need two key elements:
<at>username</at>
within the Jsonnet block.- A corresponding
entities
object within the Adaptive Card JSON payload, including the Teams user ID of the mentioned individual.
Here’s a sample mention:
Now you’re ready to enhance your Microsoft Teams notifications with interactive Adaptive Cards and mentions.