如何通过深度 link URI 在 Microsoft Teams 中打开新对话?

How to open a new conversation in Microsoft Teams via deep link URI?

我知道有一个URI方案可以打开Microsoft Teams,比如msteams://MY_PATH

现在,在给定联系人电子邮件的情况下,如何使用此 URI 方案打开与特定联系人的新对话?

附加问题:有没有什么方法可以将消息附加到新创建的对话中? 我不需要发送这条消息,只是为了在新建的会话中填写消息字段。

是的,使用深层链接绝对可以做到这一点。具体参见 Deep linking to a chat。特别是,它说:

You can create deep links to private chats between users by specifying the set of participants. If a chat doesn't exist with the specified participants, the link will navigate the user to an empty new chat.

我认为您不能直接发送附件,因为在发布第一条消息之前 实际上 不存在对话(根据 link: "New chats will be created in draft state until the user sends the first message")。不过,也许还有另一种选择 - 您可以预先创建处于草稿状态的第一条消息(请参阅可选的 "message" 参数),并且可以将 link 插入存储在团队的 SharePoint 文档存储中的文件中/ OneDrive / 其他.

示例URL:

https://teams.microsoft.com/l/chat/0/0?users=<user1>,<user2>,...&topicName=<chat name>&message=<precanned text>