@mention via incoming webhook in MS Teams

This is now supported and documented here (https://learn.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"
              }
            }
          ]
        }
      }
    }
  ]
}

Leave a Comment