我有一个 MessageCard,我通过 Incoming Webhook 连接器发送到我的 Teams 频道。这运作良好。但是,该卡有多个部分,我想Approve
为每个部分添加一个按钮,然后在完成后刷新特定部分POST
。
我已经阅读了Message Card 文档,更具体地说是Refresh Cards部分,这一切都说得通。它使我认为,我能够一次更新特定部分的唯一方法是将整个消息卡源 JSON 发送到正文中HttpPOST
,在我的自定义 API 中处理特定部分并发回带有修改部分的完整消息卡 JSON。这对我来说似乎很好,但我找不到包含源消息卡 JSON 的方法。
所以我想我的问题是:
- 我可以在
HttpPOST
操作正文中使用特定变量来发送消息卡源吗? - 有没有更好的方法来实现我想要实现的目标?
这是我的留言卡:
{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"title": "A Title",
"text": "Some text",
"themeColor": "f1c40f",
"sections": [
{
"startGroup": true,
"activityTitle": "Title1",
"potentialAction": [
{
"@type": "HttpPOST",
"body": "{{ variable containing source JSON for this whole card? }}",
"name": "Approve",
"target": "https://....."
}
]
},
{
"startGroup": true,
"activityTitle": "Title2",
"potentialAction": [
{
"@type": "HttpPOST",
"body": "{{ variable containing source JSON for this whole card? }}",
"name": "Approve",
"target": "https://....."
}
]
},
{
"startGroup": true,
"activityTitle": "Title3",
"potentialAction": [
{
"@type": "HttpPOST",
"body": "{{ variable containing source JSON for this whole card? }}",
"name": "Approve",
"target": "https://....."
}
]
}
]
}