gpt4 book ai didi

office365 - 组和团队与 Outlook 的 Webhook JSON 支持?

转载 作者:行者123 更新时间:2023-12-02 03:55:54 26 4
gpt4 key购买 nike

使用 Microsoft Teams 文档 here并点击标题为“Office 365 连接器 API 引用”的超链接,该链接链接到 https://dev.outlook.com/Connectors/Reference但重定向到:https://learn.microsoft.com/en-us/outlook/actionable-messages/card-reference我们最终得到一个标题为“可操作的消息卡引用”的页面。

这是一个非常有用的文档,列出了我们可以在 JSON 字符串中使用的所有字段来创建可操作的联系人卡,以推送到 Office 365 生态系统中的各种 Webhook 连接器。

使用 https://messagecardplayground.azurewebsites.net/ 处的 JSON 验证器我构建并测试了以下内容:

{
"title":"New Office 365 Group: Success",
"text":"Performed by: someuser",
"themeColor":"00e600",
"sections":[
{
"title":"Section Title"
},
{
"facts":[
{
"name":"Name",
"value":"PRJ000001"
}
]
},
{
"potentialAction":[
{
"@context":"http://schema.org",
"@type":"ViewAction",
"name":"View Log",
"target":"something"
}
]
}
]
}

这是有效的并且可以在该网站上正确呈现,但是当尝试将其发送到 Office 365 组邮箱或团队 channel 时,我收到错误:

通用传入 Webhook 收到错误的有效负载。

如果我们采用像这样更简单的 JSON 构造,它适用于 O365 组邮箱和团队 channel :

{
"title":"New Office 365 Group: Success",
"text":"Performed by: someuser",
"themeColor":"00e600",
"potentialAction":[
{
"@context":"http://schema.org",
"@type":"ViewAction",
"name":"View Log",
"target":[
"https://link/to/log"
]
}
]
}

似乎文档领先于服务,或者组和团队 Webhook 连接器不支持完整的选项列表,也许这仅适用于 Outlook?有什么想法吗?

谢谢。

最佳答案

现在不支持有效负载中提到的ViewAction。您应该将其替换为 OpenUri 操作。您可以在我们的文档中找到更多信息:https://learn.microsoft.com/en-us/outlook/actionable-messages/card-reference

请使用以下有效负载,它应该可以正常工作。

{
"title": "New Office 365 Group: Success",
"text": "Performed by: someuser",
"themeColor": "00e600",
"sections": [{
"title": "Section Title"
}, {
"facts": [{
"name": "Name",
"value": "PRJ000001"
}
]
}, {
"potentialAction": [
{
"@context": "http://schema.org",
"@type": "OpenUri",
"name": "View Log",
"targets": [{
"os": "default",
"uri": "http://..."
}
]
}
]
}
]
}

如果您遇到任何其他问题,请告诉我们。

关于office365 - 组和团队与 Outlook 的 Webhook JSON 支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43939827/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com