[英]Trying to use Graph API to get user's channels and post messages to MS Teams Channel from Web App
I'm trying to write a web app on our website which gets a User's MS Team channels and then posts a message to a channel of their choosing using MS Teams Graph API.我正在尝试在我们的网站上编写一个 web 应用程序,该应用程序获取用户的 MS Team 频道,然后使用 MS Teams Graph API 将消息发布到他们选择的频道。
I'm about to get an access token using the OAuth API, and I'm passing access token (AAD token) to the /me/joinedTeams endpoint, it's giving me the below error:我即将使用 OAuth API 获取访问令牌,并且我将访问令牌(AAD 令牌)传递给 /me/joinedTeams 端点,它给了我以下错误:
{ "error": { "code": "ResourceNotFound", "message": "Resource not found.", "innerError": { "date": "2021-05-14T20:57:03", "request-id": "30d80d9a-66f4-47ff-ab11-dacb7f817806", "client-request-id": "30d80d9a-66f4-47ff-ab11-dacb7f817806" } } } { "error": { "code": "ResourceNotFound", "message": "Resource not found.", "innerError": { "date": "2021-05-14T20:57:03", "request-id" “:“30d80d9a-66f4-47ff-ab11-dacb7f817806”,“客户端请求-id”:“30d80d9a-66f4-47ff-ab11-dacb7f817806”}}}
Screenshot of my Graph Explorer results我的 Graph Explorer 结果的屏幕截图
UPDATE:更新:
I have gotten my account converted to a Work account, and added the permissions.我已将我的帐户转换为工作帐户,并添加了权限。 Now I am getting this response/error:现在我收到此响应/错误:
Screenshot of new Graph Explorer results新 Graph Explorer 结果的屏幕截图
It's better for you to share how to get an access token using the OAuth API.最好分享一下如何使用 OAuth API 获取访问令牌。 In this issue, it seems your signed-in user is a personal Microsoft account, that's not supported to access the /me/joinedTeams
endpoint.在此问题中,您的登录用户似乎是个人 Microsoft 帐户,不支持访问/me/joinedTeams
端点。 Doc of this API.此API的文档。
There are some notes here:这里有一些注意事项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.