MS 团队获得花名册 returns "The bot is not part of the conversation roster."

MS Teams Get Roster returns "The bot is not part of the conversation roster."

我正在尝试获取 MS Teams 烘焙机/用户配置文件。 以下是我进行的 Postman 调用的顺序:

Generated Access Token: https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token

Generated User Access Token: https://login.microsoftonline.com/{{TenantId}}/oauth2/v2.0/token Get

My Joined Team: https://graph.microsoft.com/v1.0/me/joinedTeams

Get Internal Team Id:https://graph.microsoft.com/v1.0/teams/{{TeamId}}/channels

Fetch Roster/user profile:https://{{ServiceUrl}}/v3/conversations/{{tId}}/members/

一切正常,但今天我收到 403 禁止错误

{
    "error": {
        "code": "BotNotInConversationRoster",
        "message": "The bot is not part of the conversation roster."
    }
}

请注意,我可以与机器人进行通信。

以下是我为委托和申请提供的权限 Directory.Read.All Group.Read.All Group.ReadWrite.All User.Read User.Read.全部 User.Read基本.全部

有什么解决办法吗?

请注意,您最后一次调用 "serviceurl" 的调用显然不是图表的一部分。因此,它的身份验证是不同的。在这种情况下,Teams 将其验证为机器人,并且它需要某些权限。例如,机器人必须安装到有问题的团队中,以便获得该团队的花名册。你说它以前有效——是在同一个团队中吗?如果不是,则需要将该机器人添加到该团队。如果 "yes",那么机器人可能被某人从团队中移除了?

您必须先将机器人安装为团队中的应用,然后才能调用此 API。通过 webhook 向它发送消息不算在内。它必须是团队中安装的应用程序。由于机器人正在检索个人信息,因此需要在 API 起作用之前将其添加到该上下文中。

参见: