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.
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.
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.
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.
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.
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" } } ] } } }]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With