0
votes

I was trying to post some notifications from Azure DevOps Pipeline notifications using curl to MS teams channel. I used the Text Features Adaptive card from the MS Documentation, it was unable to post the message. other adaptive cards are able to post notifications with below curl command.

curl -XPOST -H "Content-type: application/json" -d '{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": “1.0”,
"body": [
    {
        "type": "TextBlock",
        "text": "This is some **bold** text"
    },
    {
        "type": "TextBlock",
        "text": "This is some _italic_ text"
    },
    {
        "type": "TextBlock",
        "text": "- Bullet \r- List \r",
        "wrap": true
    },
    {
        "type": "TextBlock",
        "text": "1. Numbered\r2. List\r",
        "wrap": true
    },
    {
        "type": "TextBlock",
        "text": "Check out"
    }
]
}'https://outlook.office.com/webhook/fdb-XXXX-XXXX-XXXX/e966e859-4ec9-497a-b1b8-5e6fadb19404 
(sample Income web-Hook)

I am receiving the Invalid webhook URL or HTTP 400 Bad Request and Summary or Text is the required message. can MS Teams adaptive cards support the Text feature by incoming webhook notifications?

1

1 Answers

1
votes

Yes, It supports "Text" feature. Please refer here for more details.

Here is sample JSON.

{
"type":"message",
"attachments":[
   {
     "contentType":"application/vnd.microsoft.card.adaptive",
     "contentUrl":null,
     "content":{
        "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
        "type":"AdaptiveCard",
        "version":"1.2",
        "body":[
            {
            "type": "TextBlock",
            "text": "For Samples and Templates, see https://adaptivecards.io/samples](https://adaptivecards.io/samples)",
            }
         ]
      }
   }
 ]
}