Forum Discussion
troyhart
Jan 16, 2024Copper Contributor
Posting adaptivecard to teams incoming webhooks
I have encountered a strange issue that I cannot get past. It has to do with MS Teams incoming webhooks and AdaptiveCards. The issue is that webhooks on some (not all) channels have stopped working. ...
troyhart
Jan 16, 2024Copper Contributor
My original message was truncated. Here's the payload that will successfully POST because it is missing the `actions` section:
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"type": "AdaptiveCard",
"schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6",
"body": [
{
"text": "🚀 testing",
"wrap": true,
"size": "Large",
"weight": "Bolder",
"color": "Good",
"type": "TextBlock"
},
{
"facts": [
{
"title": "DeploymentId: ",
"value": "dep-id-123"
}
],
"type": "FactSet"
}
]
}
}
]
}
- Meghana-MSFTJan 17, 2024
Microsoft
Thank you for reporting this, we will check this and get back to you.- Meghana-MSFTJan 17, 2024
Microsoft
troyhart - We checked the payload with `actions`. We also got Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId 01=2 error. We see that
height property accepts "auto" or "stretch". After changing the height value from automatic to auto/stretch, JSON is working fine.Please change this value to "auto" or "stretch" and try to send the payload again. Please confirm if this helps?
- troyhartJan 19, 2024Copper Contributor
Thank you! That worked. It's interesting to note that the invalid height value does not consistently break the POST. I have some channels that continue to accept the POST with a height of "Automatic". Also, the channels whose webhooks are consistently not accepting the POSTs now did accept them at one time.