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

Viewed 1899

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

Thanks!

1 Answers

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)
}]
}
Related