简体   繁体   English

如何通过深层链接 URI 在 Microsoft Teams 中打开新对话?

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

I know there is a URI scheme that can open Microsoft Teams, such as msteams://MY_PATH .我知道有一个可以打开 Microsoft Teams 的 URI 方案,例如msteams://MY_PATH

Now, how can I use this URI scheme to open a new conversation with a specific contact, given the contact email?现在,给定联系人电子邮件,我如何使用此 URI 方案打开与特定联系人的新对话?

Bonus question: is there any way I can also attach a message to the newly created conversation?额外问题:有什么方法可以将消息附加到新创建的对话中? I don't need this message to be sent, but only to fill the message field in the newly created conversation.我不需要发送这条消息,只需要填写新创建的对话中的消息字段。

Yes, it's definitely possible to do this using Deep Links.是的,使用深层链接绝对可以做到这一点。 In particular see Deep linking to a chat .特别是请参阅深层链接到聊天 In particular, it says:特别是,它说:

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.如果与指定参与者的聊天不存在,则该链接会将用户导航到一个空的新聊天。

I don't think you can send an attachment directly, as the conversation doesn't actually exist until the first message is posted (per the link: "New chats will be created in draft state until the user sends the first message").我认为您不能直接发送附件,因为在发布第一条消息之前,对话实际上并不存在(根据链接:“在用户发送第一条消息之前,将在草稿状态下创建新聊天”)。 Perhaps there is an alternative though - you can pre-create the first message in a draft state (see the optional "message" parameter) and you could insert a link to a file stored in the Team's SharePoint document store / OneDrive / other.也许还有一种替代方法 - 您可以在草稿状态下预先创建第一条消息(请参阅可选的“消息”参数),并且可以插入指向存储在团队的 SharePoint 文档存储/OneDrive/其他中的文件的链接。

Example URL:示例网址:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM