问题描述
我正在使用 MS Graph API Explorer 向 Teams 中的频道发送消息,但是每当我发送附加了自适应卡片的消息时,它都会在卡片顶部添加填充,并在卡片上添加一个 3 点菜单右侧带有“复制”选项。
Microsoft 文档中的示例似乎没有这个问题。
Image of Card in Teams with extra padding at top
有没有办法删除这个填充和菜单?或者我可以更改此空间中显示的内容吗?
我正在使用以下端点... https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages
使用以下请求正文...
{
"body": {
"contentType": "html","content": "<attachment id=\"4465B062-EE1C-4E0F-B944-3B7AF61EAF40\"></attachment>"
},"attachments": [
{
"id": "4465B062-EE1C-4E0F-B944-3B7AF61EAF40","contentType": "application/vnd.microsoft.card.adaptive","content": "{\n \"type\": \"AdaptiveCard\",\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\n \"version\": \"1.3\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"size\": \"Large\",\n \"weight\": \"Bolder\",\n \"text\": \"My News Item\",\n \"wrap\": true\n }\n ],\n \"actions\": [\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"View\",\n \"url\": \"https://bing.com\"\n }\n ]\n }"
}
]
}
解决方法
目前,这是不可能的。
据微软称,这是设计使然......
Link to Microsoft Tech Community Discussion
我为 Microsoft 添加了用户语音建议,以扩展架构以包含执行此操作的选项。如果你最终遇到和我一样的问题,至少你可以增加这个功能请求的权重...