无法通过HttpPOST在微软团队的可操作卡片中点击网址

时间:2017-08-07 09:33:29

标签: microsoft-teams

我正在尝试使用Actionable Message为Microsoft团队制作ActionCard

我想点击HttpPost的网址。当我点击网址时,收到错误消息:

Failed to send

There was a problem submitting your changes. Try again in a minute.

我遵循了Microsoft的文档,根据文档,我的代码是正确的。我很困惑为什么会出现这个错误。

这是我正在使用的ActionCard:

{
    "@type": "ActionCard",
    "name": "Selector",
    "inputs": [{
        "@type": "MultichoiceInput",
        "id": "list",
        "title": "Select a status",
        "isMultiSelect": "false",
        "style": "expanded",
        "choices": [{
                "display": "In Progress",
                "value": "1"
            },
            {
                "display": "Active",
                "value": "2"
            },
            {
                "display": "Closed",
                "value": "3"
            }
        ]
    }],
    "actions": [{
        "@type": "HttpPOST",
        "name": "Save",

        "body": "value={{list.value}}",
        "target": "https://www.google.com"
    }]
}

1 个答案:

答案 0 :(得分:0)

Microsoft Teams正在出现错误,因为您的通话导致错误。

您的代码看起来不错,但您的目标网址(Google.com)无效。您无法向https://www.google.com发出POST请求。尝试这样做会产生Error 405 (Method Not Allowed)

制作HttpPOST需要一个愿意接受它的目标并返回某种类型的2xx Success响应。通常情况下它会200 OK,但有些API会更精确地反映其响应(201 Created202 Accepted等。)