通过MS Teams中的传入Webhook @提及

Dav*_*ien 5 microsoft-teams

我正在尝试从传入的Webhook中提及一个用户。

我通过Postman尝试了几次迭代

{
"text": "test @user"
}
Run Code Online (Sandbox Code Playgroud)

要么

{
"text": "test @user@email.com"
}
Run Code Online (Sandbox Code Playgroud)

但这些似乎都不起作用。这简单但非常重要的事情不可能吗?

谢谢。

Ari*_*sky 24

现在支持并记录在这里https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cconnector-html#用户在带有自适应卡的传入 webhook 中提及)。

样本:

{
  "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": "AdeleV@contoso.onmicrosoft.com",
                "name": "Adele Vance"
              }
            },
            {
              "type": "mention",
              "text": "<at>Adele AAD</at>",
              "mentioned": {
                "id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
                "name": "Adele Vance"
              }
            }
          ]
        }
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

  • 该文档目前有一个注释,指出通知“将在未来版本中提供”。它似乎已经适用于[某些](/sf/answers/4855552481/),但不适用于所有人。 (3认同)

Bil*_*SFT 6

恐怕这还不可能-提及@的唯一方法是使用完整的Bot Framework API。

您并不是唯一一个要求这样做的人,所以我会在积压中解决。

  • 谢谢比尔。我们在为我们的客户(主要是 AWS)构建和部署到他们的 Slack 频道期间使用了大量通知。我现在遇到了我的第一个 Teams 客户,并且很惊讶地发现这不起作用。我可以在 Github 上执行该任务吗? (4认同)