Loading...
Skip to main content

Microsoft Teams

Microsoft Teams Bot Requirements

To send notifications via Microsoft Teams, a Microsoft Teams Bot is required. You may use an existing or create a new one.

Profile Requirements

With Microsoft Teams, Courier can send a message to either Users that are part of a tenant or the Channel.

To locate your tenant_id, you can navigate to https://teams.microsoft.com/?tenantId and copy the value from the redirected url tenantId query parameter. If the parameter doesn't show up in the url, click the three dots next to your Team and click Get link to team to find a link with the tenantId parameter.

Locate Link to Find tenantId

Send a message to a Microsoft Teams User

To deliver a message to a recipient over Microsoft Teams, Courier must be provided with the ID of the intended recipient user_id, the tenant ID for the Microsoft Teams account that recipient is a user of tenant_id, and the service URL associated with that Microsoft Teams tenant service_url.

You can follow the steps in this Microsoft Teams article in order to fetch the roster or user profile for your bot. To retrieve the authentication token, make the call in step 1 of this Microsoft Teams article.

// Recipient Profile
{
"ms_teams": {
"user_id": "",
"tenant_id": "",
"service_url": "https://smba.trafficmanager.net/amer"
};
}

Send a message to an Microsoft Teams Channel

To deliver a message to a channel over Microsoft Teams, Courier must be provided with the ID of the channel and the service URL associated with that Microsoft Teams tenant.

To locate the conversation_id open Microsoft Teams in the browser and use the threadId query parameter from the url.

// Recipient Profile
{
"ms_teams": {
"conversation_id": "",
"tenant_id": "",
"service_url": "https://smba.trafficmanager.net/amer"
};
}
info

If you are located in the Americas Region, the service url is https://smba.trafficmanager.net/amer.

Overrides

Overrides can be used to change the App ID and App Password of an Azure Bot. Below is an example of overriding the ID and password:

{
"event": "<COURIER_NOTIFICATION_ID>",
"recipient": "katherine_pryde",
"profile": {
"ms_teams": {
"user_id": "a-user-id",
"tenant_id": "a-tenant-id-or-group-id",
"service_url": "https://smba.trafficmanager.net/amer"
}
},
"data": {
"name": "Katherine Pryde"
},
"override": {
"msteams": {
"config": {
"appId": "<App ID>",
"appPassword": "<App Password>"
}
}
}
}