在使用Microsoft Graph API的Microsoft Teams中代表用户发布消息时出现错误“未经授权-401”

问题描述 投票:0回答:1

我正在使用Microsoft Graph API代表用户在Microsoft Teams中发布消息,但出现以下错误:

在委派模式下调用时,用户ID必须与api调用者匹配

完整的错误响应如下:

{
    "error": {
        "code": "Unauthorized",
        "message": "User Id must match the api caller when called in delegated mode",
        "innerError": {
            "request-id": "87113028-5d7c-41e6-8a2b-918335117ec6",
            "date": "2020-06-05T09:08:13"
        }
    }
}

任何人都可以提出解决上述问题的建议。我正在使用全局管理员凭据来代表用户发布消息。还可以使用下面的链接代表Microsoft Teams中的用户发布消息吗?https://docs.microsoft.com/en-us/graph/auth-v2-user

提前感谢。

microsoft-graph microsoft-teams
1个回答
0
投票
@@ Pravin,您的情况不是很清楚,我建议您考虑使用Graph API进行主动消息传递。请检查Proactive messaging documentations。如果您的情况是使用Graph向用户发送send吟消息,请选中Chat messages documentation
© www.soinside.com 2019 - 2024. All rights reserved.