Teams channel message is not displayed in html format

Anson Tsang 10 Reputation points
2024-11-05T06:25:09.04+00:00

We have an integration that send message to team channel using MS Graph API. Here is an example of the payload.

url: https://graph.microsoft.com/v1.0/teams/{teamId}/channels/{channelId}/messages

body payload:

{

    "body": {

        "contentType": "html",

        "content": "<html><div style="display:flex; align-items:center; margin:0px 0px 10px 0px;"><div style="display:flex; flex-direction:column;"><div> 5000 Samples </div><div> Access Asia </div></div></div><div style="display:flex;"><div style="width:80px; margin:0px 10px 0px 20px;">Revenue</div><div>$12,000.00</div></div><div style="display:flex;"><div style="width:80px; margin:0px 10px 0px 20px;">Assigned to</div><div>Micheal Boone</div></div><div style="display:flex;"><div style="width:80px; margin:0px 10px 0px 20px;">Due date</div><div>2022-05-31</div></div><div style="display:flex;"><div style="width:80px; margin:0px 10px 0px 20px;">Stage</div><div>Contracting</div></div><div style="display: flex;justify-content: flex-end;"><a href="https://developmentw.maximizercrmlive.com/Anson2024M4?ssopp=KEY(T3Bwb3J0dW5pdHkJMjIwNTA1MjUyMjI3MzkzMDQwMDMwTwkw)" style="border:1px solid black; padding:5px; margin:10px;">Go to Opportunity</a></div></html>"

    }

}

The message is able to display in html format in Sept.

But recently, we found that the message is display in a single line with all text and link.

Here are the screenshots in web and desktop versions of Teams. All messages are sent to MS Graph API with same method shown above, but they are displayed in different format.

web teams

[web teams screenshot] The channel message is not displayed in html format as expected.

desktop teams 1

[desktop teams screenshot 1] It is the same channel shown in [web teams screenshot]. The message content is the same, and the messages are able to be displayed in html format.

desktop teams 2

[desktop teams screenshot 2] It is in a weird scenario, the messages are sent with the same html format. Some of them are displayed in html format but some of them are not.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,453 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,488 questions
{count} votes

1 answer

Sort by: Most helpful
  1. cKenny 0 Reputation points
    2024-12-03T05:28:01.2233333+00:00

    I have a Power Automate flow that will capture an event where a new document was submitted and post message to a MS Team Chat group with html content. It works well until end of October 24. Starting November 24, the message only showed in plain text. The Power Automate flow has been checked, no changes to the output.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.