My INSURER PTE LTD - Insurtech Innovation Award 2024
Microsoft Team Messaging Extension Deep Dive
1. Search Based
Messaging Extension
Build Messaging Extension with Microsoft Teams App
MS Teams Azure Bot
Action Based
Messaging Extension
Link Unfurling
Messaging Extension
3. Build Messaging Extension with Microsoft Teams App
Overview
• Messaging Extension overview
• Search based Commands
• Action based Commands
• Link Unfurling
• Use Case : Search Patient via Custom API
using Messaging Extension
4. Overview of Messaging Extension in Microsoft Teams
What are Messaging Extensions ?
A way to “extend the message” and make conversation more interactive
A concept piggy-backing on the Bot Framework Invoke command
“Messaging extensions enable users to execute search queries or trigger actions in external systems. The
results of these actions are sent from your custom web service to the Microsoft Teams client as embedded
web pages or richly formatted cards”
5. Can be invoked from one of the following location in Microsoft Teams App
1. Command Box
2. Compose Message Box
3. Message More Action Menu
• Implemented as Web Services
• Microsoft Teams Communicate with the web services via Bot Framework
• Messaging Extension are registered as bots with Bot Framework
• Web Services responds with task modules or rich formatted cards
How Messaging Extension Works
8. Search command can be trigger from
the following locations
1. Command Box
2. Compose Message Box
Developing Search Commands with message extension handlers
9. Search based Messaging Extension
• Search Query is send from Microsoft Teams to your web services.
• Your web services responds with list or grids of results.
• When user select a results, it is added to compose message box as a card or text.
10. Register search based Messaging Extension in the app manifest file
"composeExtensions": [
{
"botId": "",
"canUpdateConfiguration": true,
"commands": [
{
"id": "searchQuery",
"context": [ "compose", "commandBox" ],
"description": "Test command to run query",
"title": "Search",
"type": "query",
"parameters": [
{ … }
] } ] } ]
14. Messaging Extension Action Scenario
Perform action in external system & include result in conversation
Complete complex tasks involving multiple steps and share results
15. Developing action based Messaging Extension (1/2)
The messaging extensions action command allows users to collect information using modal
popup, process their information, and send it back to the Teams channel conversation area.
When Invoked, JSON payload
send to registered web
services.
When web services respond
with task module implemented
with web interface or adaptive
cards.
18. How will the action commands respond
Decide how the message will be sent back to user
• Insert message in the compose message box ?
• Respond directly to a conversation ?
When respond directly to conversation, must also register the web services as a bot in the
app manifest.
22. Link Unfurling Messaging Extension
• Messaging extensions Link Unfurling invokes the activity when the hyperlink from defined domain
(defined or whitelist into the manifest file) is pasted into the message compose area.
• Link Unfurling help to respond to the full hyperlink with richly formatted card as well as
additional information similar to search result
Bots in Microsoft Teams can be part of a one-to-one conversation, a group chat, or a channel in a team. Each scope provides unique opportunities, and challenges, for your conversational bot.
Bots created using the Microsoft Bot Framework are diverse and can be used in multiple platforms. Bots developed for Microsoft Teams contain some differences from other platforms. The primary difference in bots developed for Microsoft Teams is in how activities are handled.
The Microsoft Teams activity handler derives from the Bot Framework's activity handler to route all Teams activities before allowing any non-Teams-specific activities to be handled.
Bots created using the Microsoft Bot Framework are diverse and can be used in multiple platforms. Bots developed for Microsoft Teams contain some differences from other platforms. The primary difference in bots developed for Microsoft Teams is in how activities are handled.
The Microsoft Teams activity handler derives from the Bot Framework's activity handler to route all Teams activities before allowing any non-Teams-specific activities to be handled.
Messaging extensions take advantage of the Bot Framework's messaging schema and secure communication protocol to connect with Microsoft Teams Client App.
Channels contain threaded conversations between multiple people. This potentially gives your bot massive reach, but individual interactions need to be concise. Traditional multi-turn interactions probably won't work well. Instead, look to use interactive cards or task modules, or potentially move the conversation to a one-to-one conversation if you need to collect lots of information.
Your bot only has access to messages where it's @mentioned directly. You can retrieve additional messages from the conversation using Microsoft Graph.
Some scenarios where bots excel in a channel include:
**Notifications**, particularly if you provide an interactive card for users to take additional information.
**Feedback** scenarios like polls and surveys.
Interactions that can be resolved in a **single request/response cycle**, where the results are useful for multiple members of the conversation.
Channels contain threaded conversations between multiple people. This potentially gives your bot massive reach, but individual interactions need to be concise. Traditional multi-turn interactions probably won't work well. Instead, look to use interactive cards or task modules, or potentially move the conversation to a one-to-one conversation if you need to collect lots of information.
Your bot only has access to messages where it's @mentioned directly. You can retrieve additional messages from the conversation using Microsoft Graph.
Some scenarios where bots excel in a channel include:
**Notifications**, particularly if you provide an interactive card for users to take additional information.
**Feedback** scenarios like polls and surveys.
Interactions that can be resolved in a **single request/response cycle**, where the results are useful for multiple members of the conversation.
Group chats are non-threaded conversations between three or more people. They tend to have fewer members than a channel and are more transient. Similar to a channel, your bot will only have access to messages where it's @mentioned directly.
Scenarios that work well in a channel will usually work as well in a group chat.