Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@mention via incoming webhook in MS Teams

Tags:

I'm trying to mention a user from an incoming webhook.

I tried a few iterations via Postman of

{ "text": "test @user" } 

or

{ "text": "test @[email protected]" } 

but none of these seem to work. Is this simple but very important thing just not possible?

Thanks.

like image 470
David O'Brien Avatar asked Feb 02 '18 02:02

David O'Brien


People also ask

How do you @mention someone within Teams?

To get someone's attention in a channel conversation or a chat, @mention them. Just type @ before their name and then select them from the menu that appears.

How do I get a webhook URL for Microsoft Teams?

Open MS Teams, select “Channel,” and then click on More options (…) and choose Connectors. 2. A pop-up window will come up. Select All from the Category section in the left pane, find Incoming Webhook, and click Add button to add Incoming Webhook.

How do you send a message to Teams on webhook?

To send a message through your Incoming Webhook or Office 365 Connector, post a JSON payload to the webhook URL. This payload must be in the form of an Office 365 connector card. You can also use this JSON to create cards containing rich inputs, such as text entry, multiselect, or selecting date and time.


2 Answers

I'm afraid this isn't possible yet - the only way to do @ mentions is by using the full Bot Framework APIs.

You're not the only one to have asked for this though, so I'll get it on the backlog.

like image 162
Bill Bliss - MSFT Avatar answered Sep 28 '22 19:09

Bill Bliss - MSFT


This is now supported and documented here (https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cconnector-html#user-mention-in-incoming-webhook-with-adaptive-cards).

Sample:

{ "type": "message", "attachments": [     {     "contentType": "application/vnd.microsoft.card.adaptive",     "content": {         "type": "AdaptiveCard",         "body": [             {                 "type": "TextBlock",                 "size": "Medium",                 "weight": "Bolder",                 "text": "Sample Adaptive Card with User Mention"             },             {                 "type": "TextBlock",                 "text": "Hi <at>Adele UPN</at>, <at>Adele AAD</at>"             }         ],         "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",         "version": "1.0",         "msteams": {             "entities": [                 {                     "type": "mention",                     "text": "<at>Adele UPN</at>",                     "mentioned": {                       "id": "[email protected]",                       "name": "Adele Vance"                     }                   },                   {                     "type": "mention",                     "text": "<at>Adele AAD</at>",                     "mentioned": {                       "id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",                       "name": "Adele Vance"                     }                   }             ]         }     } }] 

}

like image 20
Ariel Popovsky Avatar answered Sep 28 '22 20:09

Ariel Popovsky