Guide to integrate Microsoft Teams App for sending notification to user DM or channels in any workspace.
Creat a Microsoft 365 Account
Navigate to Apps
Add a name and other details
Add Bot
Get started with the Azure Portal
Navigate to Authentication from the left panel
Accounts in any organizational directory
and save.Add your Recently Created Bot
Add specific info about your bot, and add some permissions
Section | Permissions |
---|---|
Team Permissions -> Application | Channel.Create.Group , Channel.Delete.Group , ChannelMessage.Read.Group , ChannelMessage.Send.Group , TeamsActivity.Send.Group |
Chat/Meeting Permissions -> Application | ChatMessage.Read.Chat , ChatMessage.Send.Chat |
User Permissions -> Application | TeamsActivity.Send.User |
Publish your App to make it available for use.
Add the Client ID
Application (client) ID
and client secret
(in Password field) generated while creating bot in the above step.
Sending a direct message
tenant_id
, service_url
of the tenant, and conversation_id
or user_id
corresponding to user personal chat.You can pass this information in a json format using user.add_ms_teams
method as below:Sending to a channel
tenant_id
, service_url
of the tenant, and conversation_id
of the teams chat channel.+
icon to add a tab. In Add a tab modal, click on “More Apps”.distinct_id
as channel_<channel_name>
so it’s easy for you to remember and pass in your workflow calls whenever you want to send message on a teams channel.Sending message using incoming webhook
user.add_ms_teams
method as below:incoming_webhook->url
, or the bot configurations like tenant_id
, conversation_id
and serive_url
. If there are multiple keys in user.add_ms_teams()
call, the order of precedence is as follows:
incoming_webhook->url
> conversation_id
> user_id
. E.g., if your add_ms_teams argument is as follows:
{"incoming_webhook": { "url": "https://wnk1z.webhook.office.com/webhookb2/XXXXXXXXX"}}
In case you don’t have vendor defined for a tenant, notifications will automatically fallback to the default vendor credentials.Refer Steps to configure tenant level vendor here