通过图形 API 访问和创建团队聊天 [英] Accessing and creating Teams Chats via Graph API

查看:77
本文介绍了通过图形 API 访问和创建团队聊天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览 Graph API 的 Microsoft Teams 部分,并试图找出如何做两件事:

I'm going over the Microsoft Teams section of the Graph API and trying to find out how to do two things:

  1. 创建一个新的聊天,给它一个 topic 与我们应用程序中的一个实体相关联(基本上是围绕一个实体创建一个聊天),邀请特定用户加入其中,并将消息发送到聊天.

  1. Create a new chat, giving it a topic that correlates to an entity in our app (essentially creating a chat around an entity), invite specific users into it, and send messages to the chat.

访问当前登录用户的私人聊天,按他们的topic 过滤,并在我们的应用程序中显示他们的内容.

Access the currently logged-in user's private chats, filtered by their topic, and show their contents inside our app.

对于 #2,看起来应该可以使用 Graph API 的 beta 端点,但是当我尝试访问 https://graph.microsoft.com/beta/me/chats,并在我自己的应用程序中启用 Chat.Read 权限.

For #2, it looks like it should be possible using beta endpoint of the Graph API, but I get 403 Forbidden errors both in the Graph Explorer when trying to access https://graph.microsoft.com/beta/me/chats, and in my own app, after enabling the Chat.Read permissons for it.

对于#1,API 似乎根本不支持创建新聊天.

For #1, it looks like the API doesn't officially support creating new chats at all.

有什么方法可以用来创建和管理聊天?是否有替代方案,也许不是基于 MicrosoftGraph 的 API?

Is there any approach we can use to create and manage chats? Is there an alternative, perhaps not MicrosoftGraph-based API?

推荐答案

在 MS 团队中,有一个名为 ChatMessage 的 api 用于向聊天发布消息(仅当聊天已存在或已开始时)).但是,没有用于创建/开始新聊天的 api.我提出了一个功能请求.一定要为此投票以向 Microsoft 提出这个想法.https://microsoftteams.uservoice.com/forums/913786-microsoft-teams-free/suggestions/38776681-it-would-be-awesome-l-if-there-is-an-api-functiona

In MS teams, there is a api called ChatMessage to post a message to a chat(only if the chat already exist or started). But, there is no api to create/start a new chat. I have raised a feature request. Do vote for this to suggest this idea to Microsoft. https://microsoftteams.uservoice.com/forums/913786-microsoft-teams-free/suggestions/38776681-it-would-be-awesome-l-if-there-is-an-api-functiona

这篇关于通过图形 API 访问和创建团队聊天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆