无法通过客户端凭据提供程序流在Channel中发送消息-Microsoft Graph API

问题描述

我正在尝试通过客户端凭据提供程序流在Microsoft Teams Channel中发送消息。但这会产生以下错误。

enter image description here

我遵循了文档here

POST /teams/{id}/channels/{id}/messages

这是我的API权限的样子。

enter image description here

我不确定我们是否可以通过该应用程序在通道上发送消息。因为我不想通过委托方式发送它。有什么办法可以做到这一点?

更新: 这就是我生成令牌的方式。

enter image description here

更新2: 邮递员请求的屏幕截图。

enter image description here

解决方法

通常来说,您错过了 Authorization 标头中的“ Bearer”。

enter image description here

但是根据我的测试,尽管我们添加了Group.ReadWrite.AllTeamwork.Migrate.All应用程序权限,但仍会出现401 Unauthorized错误。

经过研究,我发现应用程序模式的用例是Import third-party platform messages to Teams using Microsoft Graph

请参见示例here

恐怕我们必须使用委托方式将消息发送到Teams频道。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...