Forum Discussion

Keerthi_sh2085's avatar
Keerthi_sh2085
Copper Contributor
Feb 06, 2024

HTTP POST request to incoming webhook with valid adaptive card json payload returns a 200 with error

Hi,

We have been using incoming webhook with Adaptive card for quite a few years now and we started noticing a valid adaptive card json has started returning 200 with error "Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId 01=2.." and no messages are going through in Teams. It looks like multiple RichTextBlock is not being accepted but it is valid when i tried in Visualizer | Adaptive Cards. If i remove the RichTextBlock with text "Actor: ", then the message goes through. Please look into this.

 

 

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "contentUrl": null,
      "content": {
        "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
        "type": "AdaptiveCard",
        "version": "1.2",
        "msteams": {
          "width": "Full"
        },
        "body": [
          {
            "type": "Container",
            "bleed": false,
            "minHeight": "0px",
            "isVisible": false,
            "style": "default",
            "verticalContentAlignment": "center",
            "items": [
              {
                "type": "TextBlock",
                "isVisible": false,
                "size": "large",
                "style": "heading",
                "wrap": true
              }
            ]
          },
          {
            "type": "ColumnSet",
            "isVisible": false,
            "columns": [
              {
                "type": "Column",
                "isVisible": false,
                "items": [
                  {
                    "type": "RichTextBlock",
                    "inlines": [
                      {
                        "type": "TextRun",
                        "text": "Status: ",
                        "wrap": true,
                        "fontType": "monospace"
                      },
                      {
                        "type": "TextRun",
                        "text": "",
                        "wrap": true,
                        "color": "default",
                        "weight": "bolder",
                        "fontType": "monospace"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "Column",
                "isVisible": false,
                "items": [
                  {
                    "type": "RichTextBlock",
                    "inlines": [
                      {
                        "type": "TextRun",
                        "text": "Actor: ",
                        "wrap": true,
                        "fontType": "monospace"
                      },
                      {
                        "type": "TextRun",
                        "wrap": true,
                        "size": "medium"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "ColumnSet",
            "columns": [
              {
                "type": "Column",
                "width": "stretch",
                "style": "emphasis",
                "minHeight": "40px",
                "items": [
                  {
                    "type": "TextBlock",
                    "text": "The minimal message!",
                    "wrap": true
                  }
                ]
              },
              {
                "type": "Column",
                "width": "auto",
                "verticalContentAlignment": "center",
                "isVisible": false,
                "items": [
                  {
                    "type": "ActionSet",
                    "isVisible": false,
                    "actions": []
                  },
                  {
                    "type": "ActionSet",
                    "isVisible": false,
                    "actions": []
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
}

 

  • Keerthi_sh2085 - We are able to repro this issue. We have raised a bug for the same. We will inform you once we get any further update from engineering team.

     

    Thanks, 

    Prasad Das

    ------------------------------------------------------------------------------------------ 

    If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

      • Prasad_Das-MSFT's avatar
        Prasad_Das-MSFT
        Icon for Microsoft rankMicrosoft

        Keerthi_sh2085 , In the provided JSON the TextRun elements have empty text properties. This might cause issues. Also, many elements have isVisible set to false. The ActionSet elements have empty actions arrays. 

         

        Below updated JSON works properly:

         

        {
          "type": "message",
          "attachments": [
            {
              "contentType": "application/vnd.microsoft.card.adaptive",
              "contentUrl": null,
              "content": {
                "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
                "type": "AdaptiveCard",
                "version": "1.2",
                "msteams": {
                  "width": "Full"
                },
                "body": [
                  {
                    "type": "Container",
                    "bleed": false,
                    "minHeight": "0px",
                    "style": "default",
                    "verticalContentAlignment": "center",
                    "items": [
                      {
                        "type": "TextBlock",
                        "size": "large",
                        "style": "heading",
                        "wrap": true,
                        "text": "Heading Text"
                      }
                    ]
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "items": [
                          {
                            "type": "RichTextBlock",
                            "inlines": [
                              {
                                "type": "TextRun",
                                "text": "Status: ",
                                "wrap": true,
                                "fontType": "monospace"
                              },
                              {
                                "type": "TextRun",
                                "text": "Active",
                                "wrap": true,
                                "color": "default",
                                "weight": "bolder",
                                "fontType": "monospace"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "type": "Column",
                        "items": [
                          {
                            "type": "RichTextBlock",
                            "inlines": [
                              {
                                "type": "TextRun",
                                "text": "Actor: ",
                                "wrap": true,
                                "fontType": "monospace"
                              },
                              {
                                "type": "TextRun",
                                "text": "John Doe",
                                "wrap": true,
                                "size": "medium"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "type": "ColumnSet",
                    "columns": [
                      {
                        "type": "Column",
                        "width": "stretch",
                        "style": "emphasis",
                        "minHeight": "40px",
                        "items": [
                          {
                            "type": "TextBlock",
                            "text": "The minimal message!",
                            "wrap": true
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }

         Result:

         

         

         

        Thanks, 

        Prasad Das

        ------------------------------------------------------------------------------------------ 

        If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

Resources