microsoft-teams - 使用 HttpPOST Action 表单 Teams 消息进行 POST 调用
问题描述
我有一个 MessageCard,我通过 Incoming Webhook 连接器发送到我的 Teams 频道。这运作良好。但是,该卡具有带有 HttpPOST 操作的按钮。在“目标”中,我以以下格式定义了我的 API 的 URL:“ http://user:pass@address/resource/action.html?add2Queue=test ”。当我尝试按下按钮时,我收到错误消息:“目标 URL 方案 ' http://user:pass@address/resource/action.html?add2Queue=test ' 是不允许的。”。我没有发现使用 HTTP 的任何限制。我正在使用“传入 Webhook”连接器。
它适用于 HTTP 还是仅适用于 HTTPS?
JSON:
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Action on environments status change",
"sections": [{
"activityTitle": "Envrionments status are going to change",
"facts": [{
"name": "Environment:",
"value": "3"
}, {
"name": "Due date",
"value": "On Friday 8:00 PM Central Time"
}, {
"name": "Pending Action",
"value": "Environment are going to be stopped"
}, {
"name": "Notes",
"value": "You can pause this action by pressing Pause button bellow"
}],
"markdown": true
}],
"potentialAction": [{
"@type": "HttpPOST",
"name": "Pause Action",
"actions": [{
"@type": "HttpPOST",
"name": "Pause",
"target": "http://user:pass@server/teamcity/httpAuth/action.html?add2Queue=Marlin_Infrastructure_MarlinInfrastructureStopStartEnvironments_TechnicalTasks_N"
}]
}]
}
解决方案
可以在此处找到发送不记名授权令牌的团队的说明
基于我所做的:
"@type": "HttpPOST",
"name": "Your Action",
"target": "https://www.your-url.com",
"headers": [
{
"name": "Authorization",
"value": null
}
],
"body": "{\"whateverdata\"}"
它对我有用。适用于团队,我想它也应该适用于前景
推荐阅读
- javascript -
执行 RemoveFormat 时删除标签 - android - 没有为类“BasicMessageChannel”定义“setMockMessageHandler”
' - gtsummary - gtsummary:单变量和多变量
- linux - 如何查看通过 CLI 查看图像时的时间戳
- rust - 如何从结果中取出 T
>>? - javascript - 如何在 JavaScript 中返回使用 promise 获取的文件?
- python - 如果条件满足,识别并单击无序列表中的按钮
- python - python上传大文件-错误:消息413请求实体太大-忽略100-继续
- python - (Discord.py) 我的程序无法为我的 sqlite3 文件添加价值
- android - 如何使用 Volley 发送以通过 post 检索它们以发出 PHP 请求