Webhook messages aren't delivered from azure functions

Copper Contributor

Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId 01=2

 

Worked fine since last night. Today morning this error started. Nothing changed overnight. Is this a known bug?

8 Replies
Can you try sending the message using postman once and check you are getting the same error? Also please share the JSON so that we can check from our end as well.

@Meghana-MSFT Postman_gMSlBUoZhd.png

 

 

{
    "type": "message",
    "summary": "test",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.adaptive",
            "contentUrl": null,
            "themeColor": "0072C6", 
            "summary": "test",
            "content": {
                "type": "AdaptiveCard",
                "body": [
                    {
                        "type": "TextBlock",
                        "size": "Large",
                        "weight": "Bolder",
                        "text": "test",
                        "wrap": true
                    },
                    {
                        "type": "TextBlock",
                        "size": "Large",
                        "weight": "Bolder",
                        "text": "messageTitle",
                        "wrap": true
                    },
                    {
                        "type": "TextBlock",
                        "size": "Medium",
                        "text": "asd",
                        "wrap": true
                    }
                ],
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "version": "1.0",
                "padding": "None",
                "msteams": {
                    "width": "Full",
                    "entities": [
                        {
                            "type": "mention",
                            "text": "<at>MAK</at>",
                            "mentioned": {
                                "id": "email address removed for privacy reasons",
                                "name": "name"
                            }
                        }
                    ]
                }
            }
        }
    ]
}

@abdul_kareem_mohamme - We checked this at our end, we made a change to the card to make sure it follows this pattern. It is working fine. - https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?...

 

We need to add "<at>Admin</at>"(Same as text property in entities) in text block of body so that it will show the @mention properly. We also replaced the text in entities block. Below is the final JSON.

 

 

{
    "type": "message",
    "summary": "test",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.adaptive",
            "contentUrl": null,
            "themeColor": "0072C6", 
            "summary": "test",
            "content": {
                "type": "AdaptiveCard",
                "body": [
                    {
                        "type": "TextBlock",
                        "size": "Large",
                        "weight": "Bolder",
                        "text": "test",
                        "wrap": true
                    },
                    {
                        "type": "TextBlock",
                        "size": "Large",
                        "weight": "Bolder",
                        "text": "messageTitle",
                        "wrap": true
                    },
                    {
                        "type": "TextBlock",
                        "size": "Medium",
                        "text": "Hi <at>Admin</at>",
                        "wrap": true
                    }
                ],
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "version": "1.0",
                "padding": "None",
                "msteams": {
                    "width": "Full",
                    "entities": [
                        {
                            "type": "mention",
                            "text": "<at>Admin</at>",
                            "mentioned": {
                                "id": "admin@M365x17798679.onmicrosoft.com",
                                "name": "Admin"
                            }
                        }
                    ]
                }
            }
        }
    ]
}

 

 

MeghanaMSFT_0-1697438894362.png

If you are still facing the issue even after making these changes, could you please share demo credentials where this issue is reproducible. Please share the credentials at microsoftteamsdev@microsoft.com.

What exactly has changed here? It looks the same to me.
Line number 30, 42, 44, 45.

Can we get on a call? This is running in prod for me, and is causing me a problem.

Could you please share the details offline at microsoftteamsdev@microsoft.com.
Could you please confirm if your issue has been resolved?