通过 Microsoft Graph API 发送自适应卡片 - 获取提交操作时出错

Send an adaptive card through Microsoft Graph API - Error when getting Submit Action

我可以使用下面的 JSON 发送按钮和超链接,但是每当我点击按钮时都会出现错误。

API URL - https://graph.microsoft.com/v1.0/chats/chatId/messages JSON请求:

    "body": {
        "contentType": "html",
        "content": "<attachment id=\"74d20c7f34aa4a7fb74e2b30004247c5\"></attachment>"
    },
    "attachments": [
        {
            "id": "74d20c7f34aa4a7fb74e2b30004247c5",
            "contentType": "application/vnd.microsoft.card.thumbnail",
            "contentUrl": null,
            "content": "{\r\n  \"title\": \"This is an example of posting a card\",\r\n  \"subtitle\": \"<h3>This is the subtitle</h3>\",\r\n  \"text\": \"Here is some body text. <br>\r\nAnd a <a href=\\"http://microsoft.com/\\">hyperlink</a>. <br>\r\nAnd below that is some buttons:\",\r\n  \"buttons\": [\r\n    {\r\n      \"type\": \"messageBack\",\r\n      \"title\": \"Login to FakeBot\",\r\n      \"text\": \"login\",\r\n      \"displayText\": \"login\",\r\n      \"value\": \"login\"\r\n    }\r\n  ]\r\n}",
        }
    ]
}```

添加为可见性答案:

通过图形处理按钮事件似乎不可行API。如果你想处理按钮事件,那么你可以通过 bot 发送 message/card。 您可以使用 HTTP 请求发送带有操作按钮的卡片。但是除了 Action.OpenUrl 之外的按钮动作在这里不支持。