简体   繁体   English

如何在 MS Teams 中发送主动消息

[英]How to send proactive message in MS Teams

As a part of a use case, I want to send user a proactive message from bot.作为用例的一部分,我想向用户发送来自 bot 的主动消息。 I am following this document related to sending proactive messages to bot.( Send Proactive message )我正在关注与向机器人发送主动消息相关的文档。( 发送主动消息

I am trying to send proactive message to the user when the user has not interacted with bot previously.当用户之前没有与机器人交互时,我正在尝试向用户发送主动消息。 For this scenario, I need to call 'Install App for Users' graph API and cache the necessary values from the conversation Update event bot receives upon installation.( Send proactive message when user has not interacted with bot )对于这种情况,我需要调用“为用户安装应用程序”图 API 并缓存安装时机器人接收到的对话更新事件中的必要值。( 当用户没有与机器人交互时发送主动消息

However, the permissions required to call this API are marked in private preview mode on the permissions reference page.但是,调用此 API 所需的权限在权限参考页面上以私人预览模式标记。 ( Permission Reference ) I want to know if there is any other way to send proactive message to bot other than the way mentioned above. 权限参考)我想知道除了上面提到的方式之外,是否还有其他方式可以向机器人发送主动消息。 I am attaching the screenshot of documentation for reference.我附上文档的屏幕截图以供参考。

私人预览中的权限 私人预览中的权限

As discussed this issue in Mail.正如邮件中讨论的这个问题。

To install an app in the personal scope for all users in the tenant, you can do one of the following:要为租户中的所有用户在个人 scope 中安装应用程序,您可以执行以下操作之一:

  1.  App only permission: TeamsAppInstallation.ReadWriteForUser.All
  2.  Delegated permission: TeamsAppInstallation.ReadWriteForUser -> but the token must belong to that of a Teams Service or Tenant Admin.

The 'Self' equivalent of these permissions allow the caller to install only those Teams app that have declared the app that is making the request as webApplicationInfo.Id in its manifest.这些权限的“Self”等效项允许调用者仅安装那些已在其清单中将发出请求的应用声明为 webApplicationInfo.Id 的 Teams 应用。

From the Teams App Install permissions reference , installing an application for the user can also use this permission: TeamsAppInstallation.ReadWriteForUser .Teams App Install 权限参考中,为用户安装应用程序也可以使用此权限: TeamsAppInstallation.ReadWriteForUser Although this is more privileged permission and requires admin consent, this is what should be used given that TeamsAppInstallation.ReadWriteSelfForUser is in private preview.虽然这是更多特权权限并且需要管理员同意,但鉴于TeamsAppInstallation.ReadWriteSelfForUser处于私人预览版中,应该使用此权限。

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

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