[英]In MS Team Adaptive Card, how do I specify the server it post to?
I am trying to use Action.Submit in my adaptive card to hit my Google Cloud Function.我正在尝试在我的自适应卡中使用 Action.Submit 来访问我的 Google Cloud Function。 Where do I specify where to send the submission to?我在哪里指定将提交的内容发送到哪里? The reason I am doing this is I want to skip building a full chat server due to time constraint.我这样做的原因是由于时间限制,我想跳过构建完整的聊天服务器。
Example of Adaptive Card, no property to specify post URL:自适应卡示例,没有属性可指定后 URL:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Present a form and submit it back to the originator"
},
{
"type": "Input.Text",
"id": "firstName",
"placeholder": "What is your first name?"
},
{
"type": "Input.Text",
"id": "lastName",
"placeholder": "What is your last name?"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Action.Submit",
"data": {
"x": 13
}
}
]
}
Adaptive cards aren't developed specifically for bot service.自适应卡不是专门为机器人服务开发的。 so working with them needs some tricks, in your case if you are trying to send a request that contain adaptive card inputs you need to know:因此,与他们合作需要一些技巧,在您的情况下,如果您尝试发送包含您需要知道的自适应卡输入的请求:
console.log(context.activity)控制台.log(上下文.活动)
context.activity.value.firstName (to get the firstName sent by the adaptive card) context.activity.value.firstName(获取自适应卡发送的名字)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.