How could I send an JSON message in content of request body using Graph API?

林彥良 21 Reputation points
2021-06-24T08:43:15.823+00:00

I'm using microsoft graph api to send messages to Microsoft Teams, and I noticed that in the request body all message content in "content" could only send single text.

I would like to send an JSON format message in the "content" block, so I set "contentType" as "application/json" in the request body, and the content look like this:

"content":{"value1":0.1, "value2":0.5}

However, it returns "Invalid request body content"

I could success by setting contentType as html, but how could I send JSON content?

Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
0 comments No comments
{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.