You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Teams Bot通过BotFramework API无法提及用户的问题及解决

Teams Bot群聊@用户失效问题解决记录

问题背景

已配置完成的Teams Bot可正常与用户对话、回复消息,但在群聊场景中@用户时,仅显示普通文本,无用户提及的高亮效果,已在Web版和iOS版Teams中测试验证。

尝试的操作

  • 参照官方文档编写请求发送消息,请求详情如下:
    请求地址:
    POST https://smba.trafficmanager.net/apis/v3/conversations/{groupChatId}/activities
    
    请求体:
    {
        "type": "message",
        "text": "Hey <at>Oleh</at>, check out this message!",
        "from": {
            "id": "{botId}",
            "name": "TestBot"
        },
        "conversation": {
            "id": "{groupChatId}"
        },
        "entities": [
            {
                "type":"mention",
                "mentioned":{
                    "id":"{userId}",
                    "name":"Oleh"
                },
                "text": "<at>@Oleh</at>"
            }
        ]
    }
    
  • 测试官方提供的自适应卡片示例,卡片可正常渲染,但@用户功能依旧无效。
  • 尝试在entities[0].mentioned.id字段中填入多种格式的用户标识:Teams ID(格式为"29:...")、AAD对象ID、用户邮箱,均未解决问题。

问题根源与解决方案

经排查发现问题出在API请求地址上:

  • 使用不带区域标识的URL发送消息时,@用户功能失效:
    https://smba.trafficmanager.net/apis/v3/conversations/{converrsationId}/activities
    
  • 使用带emea区域标识的URL发送消息时,@用户功能恢复正常:
    https://smba.trafficmanager.net/emea/v3/conversations/{converrsationId}/activities
    

内容的提问来源于stack exchange,提问作者Oleg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 16:01:08