

#Extensions for fluid browser how to#
This sample shows how to build a Search-based Message Extension. Message extension with search-based commands This sample shows how to define action commands, create task module, and respond to task module submit action. Message extension with action-based commands Invoked when a Messaging Extension Fetch activity is received from the connector.Īsync handleTeamsMessagingExtensionFetchTask(context, action)

Var member = await TeamsInfo.GetMemberAsync(turnContext,, cancellationToken) return TaskModuleHTMLPage(turnContext, action) Return new MessagingExtensionActionResponse Handle different actions using switch. Protected override Task OnTeamsMessagingExtensionFetchTaskAsync(ITurnContext turnContext, MessagingExtensionAction action, CancellationToken cancellationToken) The following image displays the message extension search command task module: The cards are triggered from the compose message area or the command box and not triggered from a message. When the user selects a card from the list, the full-size card is inserted into the compose message area. The Teams client renders a list of card previews for the user. You respond with a list of cards and card previews. In the most basic search command flow, the initial invoke message includes the search string that the user submitted. Search commands allow the users to search an external system for information either manually through a search box, or by pasting a link to a monitored domain into the compose message area and insert the results of the search into a message. The following image displays the message extension action command task module: When the command is invoked from a message, the initial JSON payload sent to your bot includes the entire message it was invoked from. The action commands are triggered from the compose message area, the command box, or from a message. You can chain multiple forms together for more complex workflows. After that, the user can submit the message. When the user submits the form, your web service responds by inserting a message into the conversation directly or by inserting a message into the compose message area.

Action commandsĪction commands are used to present the users with a modal pop-up to collect or display information. Some interactions, such as authentication and configuration are available for both types of commands. The message extension command type defines the UI elements and interaction flows available to your web service. There are two types of message extension commands, action command and search command. Respond with a JSON payload, allowing the Teams client to know the next interaction to enable.

On invoke, the web service receives an HTTPS message with a JSON payload including all the relevant information. The invoke locations are compose message area, command bar, and message. Each command defines a type, such as action or search and the locations in the client from where it's invoked. In the app manifest for Teams app, a single message extension is defined with up to 10 different commands. Though you can create the web service manually, use Bot Framework SDK to work with the protocol. The web service takes advantage of the Bot Framework's messaging schema and secure communication protocol, so you must register your web service as a bot in the Bot Framework. You want to complete a complex task involving multiple steps or lots of information in an external system, and share the results with a conversation.Ĭreate a bug in your tracking system based on a Teams message, assign that bug to Bob, and send a card to the conversation thread with the bug's details.Ī message extension consists of a web service that you host and an app manifest, which defines where your web service is invoked from in the Teams client. Search for a work item in Azure DevOps, and share it with the group as an Adaptive Card. You want to find something in an external system, and share the results with the conversation. Reserve a resource and allow the channel to know the reserved time slot. You want some external system to do an action and the result of the action to be sent back to your conversation. Scenarios where message extensions are used Scenario Message extensions is no longer supported in the compose box.
