Markdown Text Appears as HTML Tags When Posting to a Teams Bot

石川 敦己 170 Reputation points
2025-02-04T04:21:42.5733333+00:00

Hello,

When I send a request to post markdown text to a Teams bot, the HTML tags are displayed as plain text instead of being rendered correctly.

Example Request:

curl -X POST "https://smba.trafficmanager.net/apis/v3/conversations/{conversationId}/activities" \
     -H "Authorization: Bearer ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "type": "message",
           "text": "- test"
         }'

Message Posted by the Bot:

User's image

Other markdown formats are also converted into raw HTML strings.
I observed the same behavior when checking on both a web browser and the Windows mobile app.
Additionally, I explicitly included "textFormat": "markdown" in the request parameters, but the result remained unchanged.
My Teams client version is 49/25010620410.

Possible Causes

Do you have any insights into the cause of this issue? Some possible reasons I can think of include:

  • Misconfiguration in the Teams app or bot settings
  • Teams client settings
  • Incorrect request method
  • A bug in Microsoft Teams

Any guidance on this issue would be greatly appreciated.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,805 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,536 questions
{count} votes

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.