sharepoint - 在 Microsoft Teams webhook 消息中附加 Sharepoint 文件
问题描述
我有一个文件位于 Teams 的 Sharepoint 上以及与我在 Microsoft Teams 中的频道对应的文件夹中。
例如团队Banana
频道ripe
,所以我的文件在https://whatever.sharepoint.com/Banana/ripe
我想以编程方式将此文件与消息共享到频道以获得此结果:
我通过转到Files
选项卡,单击文件,然后在团队客户端中收到上述消息Start conversation
。
我想使用 webhook 共享此文件。
不幸的是,我找不到任何关于MessageCard
webhook 似乎使用的有效负载可以让我执行上述操作的任何内容。
我尝试attachments
像这样将部分机器人引用添加到消息中,但没有成功:
POST https://outlook.office.com/webhook/whateverelsehere HTTP/1.1
Host: outlook.office.com
Content: application/json
Content-Length: 401
{
"@type": "MessageCard",
"text":"This is a message3",
"attachments": [{
"contentType": "application/vnd.microsoft.teams.card.file.info",
"contentUrl": "https://wherever.sharepoint.com/sites/feed-support/Banana/ripe/test.txt",
"name": "text.txt",
"content": {
"uniqueId": "df90889f-e8a7-452a-8795-972be16fac6f",
"fileType": "txt",
}
}]
}
解决方案
目前无法使用 webhook 发送文件。webhook 中的文件支持是我们正在努力的工作,但我们没有针对它的 ETA。到目前为止,发送文件的唯一方法是使用 Bots。
推荐阅读
- objective-c - 检测 macOS 10.14 强调色何时更改
- go - 通用函数中的 Golang Cobra 命令标志未从 cli 获取值
- javascript - 我的 HTML 文件无法使用加载函数(jquery)加载另一个文件
- r - 并行循环多个列表 lme4
- junit - 如何在 Eclipse 中使用 Run As > SWTBot 测试运行 JUnit 5 测试
- r - ggplot facet的不同x轴
- r - 为什么在 R 中反序列化 xgboost 模型时出现此错误
- javascript - 如何使用地图洗牌数组
- c# - 查看页面未在 C#、MVC 5 中显示
- elixir - Elixir/Phoenix Framework 认证/授权