有没有办法让用户采取行动?

Is there a way to get the user made an action?

我正在尝试通过将 actor 传递给 Teams 中的卡片的 HttpPOST 操作来解决任务。 因此,一旦用户点击操作,我就可以使用 Inputs 获取用户输入,并以这种方式将其添加到 POST 操作中:

{
  "@type": "ActionCard",
  "name": "Comment",
  "inputs": [
    {
      "@type": "TextInput",
      "id": "comment",
      "isMultiline": true,
      "title": "Input's title property"
    }
  ],
  "actions": [
    {
      "@type": "HttpPOST",
      "name": "Action's name prop.",
      "target": "https://yammer.com/comment?postId=123",
      "body": "comment={{comment.value}}"
    }
  ]
}

但我想添加一些用户信息(姓名、电子邮件等)。

我们是否有一些预定义的变量可以用于它?

旁注:
1. 连接器在包含演员姓名的 HttpPOST 操作成功响应后将回复发布到卡片(因此看起来很有希望): 2. 连接器将 access_token 传递给包含一些信息(sub、tid)的 HttpPOST API 端点。但是没有任何范围,所以即使我会找到 STS 的正确 userprofile 端点,我也无法调用它
3. 基于 sample 我可以使用 ActionableMessageTokenValidator 但结果没用:

- 仅显示相同的 sub(我在令牌中看到)

相关问题:https://github.com/OfficeDev/outlook-actionable-messages-csharp-token-validation/issues/9

我已经与 Actionable Messages 团队一起调查了这个问题,这是通过连接器(mailbox/group 连接器或 Teams 连接器)接收的可操作消息的限制。

执行该操作的用户由 sub 声明表示(sender 与此无关)。 already documented,对于连接器,sub 包含对象 ID,而不是电子邮件地址。

The identity of the user who took the action. For Actionable Messages sent over email, sub would be the email address of the user. For connectors, sub will be the objectID of the user who took the action.

这不打算更改。对于 Outlook,您可以转为通过电子邮件发送可操作的消息,您将获得 sub 作为电子邮件地址的声明。对于 Teams,使用连接器是唯一的选择。

关于 sender 声明为空:这也是连接器流的限制。传入的 webhook 会生成一封电子邮件(或 Teams 的聊天消息),但实际上并不是 "sending" 这些消息。因为它们不被发送,所以发件人永远不会在邮件上加盖戳记。确定发件人的逻辑看到一个空值,因此这就是放入令牌中的内容。说明这一点的最简单方法是查看其中一封邮件的 Outlook 中的 "from" 字段,您会发现没有 电子邮件地址: