I've been experiencing this as well for a little while and thankfully came across this post today.
Remove this from your payload and it should work:
"******@odata.type": "#Microsoft.Teams.GraphSvc.conversationIdentityType",
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi all,
I am trying to post a message to a Microsoft Teams channel that includes a Channel at-mention.
https://www.expiscornovus.com/2019/05/29/mention-a-channel-with-flow/
I am using this endpoint: https://learn.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http
I have configured the appropriate permissions, but the service responds with: "Bad Request - 400 "message": "Invalid request body was sent." "
Graph Explorer does the same, of course.
To make it even weirder, last Friday it still worked.
This is my request URL: POST v1.0 https://graph.microsoft.com/v1.0/teams/6530784c-xxxx-xxxx-xxxx-8dae44cbd6eb/channels/19:7c924xxx24904xxx9xxx8a0f279xxx3c@thread.tacv2/messages
This is my request body:
{
"body": {
"content": "<at id=\"0\">General</at> test",
"contentType": "html"
},
"mentions": [
{
"id": 0,
"mentionText": "General",
"mentioned": {
"conversation": {
"id": "19:7c924xxx24904xxx9xxx8a0f279xxx3c@thread.tacv2",
"displayName": "General",
"******@odata.type": "#Microsoft.Teams.GraphSvc.conversationIdentityType",
"conversationIdentityType": "channel"
}
}
}
]
}
I tried encoding the id as included in the Body, doesn't help.
Hope some can help.
Thanks!
Joost
I've been experiencing this as well for a little while and thankfully came across this post today.
Remove this from your payload and it should work:
"******@odata.type": "#Microsoft.Teams.GraphSvc.conversationIdentityType",
Just noticed this too. We use the API for automating messages into Teams and alerting that team via the channel notification
It's been working for a few years but seems to have broken in the last few days. All testing points to the channel notification formatting causing the POST to be rejected as invalid body type