Microsoft Teams
This is a step-by-step guide to integrating and sending notifications to users on Microsoft Teams.
Prerequisites
To send notifications on Microsoft Teams, you’ll need to create a Teams bot. This bot will be responsible for sending notifications to users / channels in their Teams workspace. You’ll also need a Microsoft 365 developer account and permission to add apps to your teams. You can ask your admin to assign you relevant permission, or you can sign up for a free Microsoft 365 developer program.
Create Teams App
You’ll have to create a Teams App to send notifications via SuprSend. User will have to add this App in their Teams workspace and channel to start getting notifications through the App. You can learn more about Apps here.
Creat a Microsoft 365 Account
First, create a Microsoft 365 Developer Account. Sign in If you have an existing developer account. You’ll need permission to add Apps in your account. Ask your admin to assign you relevant permissions if you are using an existing account.
Navigate to Apps
Now, navigate to the Apps section and click on +New App.
Add a name and other details
Give your App a suitable name and Add. For your test app, you can use something like “SuprSend Test App” for app name
You’ll be redirected to a new window where you’ll have to add a few information related to your application such as company name, description, website link, URLs to register the App.
Add Bot
Now select App feature from your left panel to click on Bot. If you have an existing bot, select it from the list or click on Create a new bot On the bot page, click on +New Bot and add bot name. Add a relevant bot name and Add.
Once the bot is created, you’ll land on bot configuration page. Leave the endpoint blank, select “Microsoft teams” in the channel and create client secret for your bot. Save your bot secret somewhere safe. You’ll need this in SuprSend vendor integration form.
Get started with the Azure Portal
Now login to Azure portal and select All Apps. Here, you’ll see the recently created bot. Click on it and copy the App (client) ID. You’ll need to fill this information in SuprSend vendor integration form.
Navigate to Authentication from the left panel
After navigating, select Accounts in any organizational directory
and save.
Add your Recently Created Bot
Now that your bot is created, go back to your developer portal -> Apps and select your last created App. Select App features -> bot. In the bot configuration, add your recently created bot.
Add specific info about your bot, and add some permissions
Choose Only send notifications in “what can your bot do?”. Add personal, team and group chat in bot scopes and click on Save.
In your App permissions, add below permission.
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.
Publish to org if you want your App to be accessible only inside your organization teams. Publish to store if you want to make it publically available in the teams App store.
Your admin will have to approve the App for it to go live. For admin approval, go to admin portal and publish it again. Your App might take some time to go live once it is published.
Add the Client ID
Add client ID that you copied from azure portal into your App Basic Information:
Now go to https://teams.microsoft.com/ and ADD the app . First, from left panel select Apps with a + sign and then In the section “Built for this organization”, there will be an option to Add the app.
Add Teams integration on SuprSend
Go to SuprSend dashboard -> Microsoft teams Vendor Settings page. Add Application (client) ID
and client secret
(in Password field) generated while creating bot in the above step.
Update teams channel in user or object profile
The information required in the user profile is dependent on the type of message you are sending.
Order of Precedence
Microsoft teams profile should only contain 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
. For example, if your add_ms_teams argument is as follows:
The profile will be saved as {"incoming_webhook": { "url": "https://wnk1z.webhook.office.com/webhookb2/XXXXXXXXX"}}
Create Teams template
Refer teams template documentation for step-by-step guide on how to create, preview and publish the template.
Tenancy in Microsoft teams
In scenarios where you’re sending notifications on behalf of your enterprise clients, each with their own team applications for communicating with end-users, you can define distinct app configurations at the tenant level. In SuprSend, we presently identify tenants as tenants.
To support this, simply include the app configuration for the tenant on the vendor details page. This will override the default tenant vendor at the time of sending notification. This configuration needs to be set up once, and SuprSend will seamlessly direct all notifications associated with that tenant through the vendor configuration specified for the tenant.
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