我正在从nodeJS服务器调用MS teams graph API
const response = await axios({
url: `${GRAPH_ENDPOINT}/v1.0/chats/${chatId}/messages`,
method: 'POST',
headers: {
Authorization: `Bearer ${access_token}`,
'Content-Type': 'application/json',
},
data
});
字符串
其中data
如下:
{
"subject": null, //very important, it starts to send message from ms teams mobile app but not from windows app
"body": {
"contentType": "html",
"content": "<attachment id=\"a1b2\"></attachment>"
},
"attachments": [
{
"id": "a1b2",
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": JSON.stringify({
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"msteams": {
"type": "imBack",
"value": "Text to reply in chat"
}
}
}
]
}),
"name": null,
"thumbnailUrl": null
}
]
}
型
但是点击提交按钮不会在聊天中发送回复。我做错什么了?
1条答案
按热度按时间wydwbb8l1#
这是故意的。'imBack'或'messageBack'调用将无法通过Graph API工作。
只有'openUrl'才能工作。