如何在传入的Webhook消息中发送超链接?

时间:2018-11-17 03:39:33

标签: microsoft-teams

我知道我可以在传入的Webhook中使用html和markdown,但是当我尝试嵌入链接时,它不起作用。需要帮助

[Route("Cars")] public class CarsController : Controller { [Route("{nameCar}")] public IActionResult Index(string nameCar) { return View("Views/Home/CarsView.cshtml"); } [Route("{nameCar}/forsale")] public IActionResult ForSale(string nameCar) { return View("Views/Home/CarsForSaleView.cshtml"); } }

2 个答案:

答案 0 :(得分:1)

我之前也遇到过类似的问题,并且发现可以使用自适应卡。功能更强大!以下是有效负载示例。

{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "a summary",
"sections": [{
    "activityTitle": "A title",
    "activitySubtitle": "a subtitle",
    "markdown": true
}],
"potentialAction": [{
    "@type": "ActionCard",
    "name": "Visit",
    "actions": [{
        "@type": "OpenUri",
        "name": "Visit",
            "targets": [
                { "os": "default", "uri": "https://www.microsoft.com" }
            ]
    }]
}]

}

答案 1 :(得分:1)

可以使用标准降价:

curl --header "Content-Type: application/json" \  
     --data "{\"text\": \"[visit](https://www.microsoft.com)\"}" \  
     <my webhook url>  

请注意,OP 省略了 URI 方案,这会阻止团队将 URL 识别为有效的 URL。