无法从Microsoft Teams留言卡的“紧急操作”按钮发送http发布请求

时间:2020-01-13 15:13:12

标签: http-post webhooks microsoft-teams

我正在使用包含发布请求的按钮将卡片发送到Microsoft Teams频道。 当我单击按钮时,出现以下错误:

“发送失败

无法完成请求的操作。请稍后再试。”

@type": "MessageCard",
"@context": "https://schema.org/extensions",
"summary": "{SUMMÁRIA}",
"themeColor": "0078D7",
"title": "{TÁJ} - {TÓÉ} ",
"sections": [
    ...sectionDescription],
"potentialAction": [
    {
    "name": "BUTTON LABEL",
    "target": "https://<targetURL>",
    /* I also tried this one "headers": [{
    "name": "Authorization",
    "value": "Basic base64",
    }, {"name" : "Content-Type", "value": "application/json"}],*/
    "headers": [{"Authorization": "Basic <BASE64STUFF>"}, {"Content-Type": "application/json"}, ],
    "@type": "HttpPOST",
    "url": "https://<TARGETURL>",
    "bodyContentType": "application/json",
    "body": JSON.stringify({
        "buildType": {
            "id": "hereisTheid"
        },
        "comment": {
            "text": "message"
        },
        "properties": {
            "property": [{
                    "name": "proprety",
                    "value": "valueofproperty"
                },
                {
                    "name": "properyt",
                    "value": "valueofProperty"
                }
            ]
        },
    }),
    },
    {
        "@type": "HttpPOST",
        "name": "View Build",
        "target": "https://....."
    },
    {
        "@type": "HttpPOST",
        "name": "Test results",
        "target": "http://..."
    }
]

如何识别按钮的响应?

2 个答案:

答案 0 :(得分:1)

我根本没有使用MessageCard,所以这只是一个建议,以防万一它可以帮助您-您是否尝试过在Web客户端而不是桌面客户端中使用Teams?因为您可以使用浏览器F12开发人员工具,所以可能对此有更好的了解。

答案 1 :(得分:0)

域白色标签是否允许您使用URL?