简体   繁体   中英

How to send a Adaptive card to Microsoft teams via Microsoft Graph API/SDK?

How can we send a adaptive card to Microsoft Teams channel via Microsoft Graph API or Graph SDK. Is it even possible?

Thanks!

You could send the Adaptive card using Create chat message in a channel Graph API. Here is a sample code:

body: {
"body": {
"contentType": "html",
"content": "<attachment id="04b151bb-2f88-4f5b-9615-30b2a59d9adf">"
},
"attachments":[{
"id": "04b151bb-2f88-4f5b-9615-30b2a59d9adf",
"contentType": "application/vnd.microsoft.card.adaptive",
"content": JSON.stringify(card.attachments[0].content)
}]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM