We have same issue and are very interested in resolution to this. We have an application where we want to provide a connector to teams where user can specify destination webhook to teams and we want to use specific card formats/templating to take the data that's relevant to the message and post it to teams.
How to send Adaptive Card with inline data to Teams via Webhook?
I have created a webhook url in Teams. I'm trying to send an adaptive card that I designed using adaptivecards.io/designer
My request looks like this:
curl -X POST "$webhookUrl" -H "Content-Type: application/json" -d "@card.json"
contents of "card.json" look like this:
{
"type": "message",
"summary": "test inline data",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3",
"type": "AdaptiveCard",
"$data": {
"message": "Hello world"
},
"body": [
{
"type": "TextBlock",
"text": "${message}"
}
]
}
}
]
}
"card.json" renders as expected in the adaptivecards.io/designer:
However when I send this to the webhook, the card is not rendered correctly on Teams. It instead I only shows the template message which looks like this:
I'd like to be able to send the $data inline instead of sending a rendered card (using SDKs such as "adaptivecards-templating") to the webhook. This is because sometimes the rendered content can result in a large string and can cause 413 errors. I'd like to avoid that.
Is it possible to send $data inline to webhooks? The documentation at https://learn.microsoft.com/en-us/adaptive-cards/templating/language makes it seem like this should be possible. Why isn't my example working as expected?
2 answers
Sort by: Most helpful
-
-
Meghana-MSFT 3,771 Reputation points Microsoft Vendor
2022-12-19T14:36:22.26+00:00 My apologies for the delayed response. Engineering team has confirmed that this scenario is currently not supported. Can you please help suggesting this feature on https://feedbackportal.microsoft.com/feedback/forum/ad198462-1c1c-ec11-b6e7-0022481f8472.