Forum Discussion
dominik____
Apr 26, 2023Copper Contributor
Incoming Webhooks Emojis stopped working
Edit:
It seems that emojis are working again since 28.04.2023
---
Until 25th of April 2023 I was able to send AdaptiveCards to the Teams Incoming Webhook that contained (unicode) emojis in TextBlock text.
E.g.:
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"body": [
{
"type": "TextBlock",
"wrap": true,
"text": "🕵️ Hello"
}
]
}
}
]
}
However this stopped working and the Webhook-endpoint responds with status code 200 and following text:
Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId MS-CV=6VuKZ6LzJEy0rlogGwBLyg.0..
When sending the same message without the emoji it works as before...
What has changed? How can I fix it?
- helmroosCopper Contributor
Seeing the same problem here since this morning.
The request returns 200 OK but with a response
Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId ...
Removing the emojis from the request solved the problem.
- nbevansCopper Contributor
Same problem here. This has worked for years. Now it doesn't.
We're using the older MessageCard format on our webhook invocations and its the same problem. Error status 400 in the response body but 200 on the HTTP status. So causing a silent failure that took a while to debug!
- DeyvessonCopper ContributorI have same issue.
- dcdraperCopper Contributor
same issue here too. It does not seem to like the ';' anymore.
- Cadder_auCopper Contributor
It's not the ; that's causing the issue - it appears to be the emoji unicode, as AndyMcMullan noted, in the 10000+ range.
A quick workaround: (assuming your card is held in string $msgJSON and your webhook is $hookURL) is to remove the #x1 ...
Invoke-RestMethod -Method post -ContentType 'Application/Json' -Body $MsgJSON.replace('#x1','#x') -Uri $HookURL
worked for me.
You still get an unknown character (eg '&F4bb;') but at least it posts.
- AndyMcMullanCopper ContributorI am seeing the same problem, but with MessageCard. For example this fails:
{
"@context": "https://schema.org/extensions",
"@type": "MessageCard",
"themeColor": "abcdef",
"title": "Hello World",
"text": "Hello 🟥"
}
If I remove the red square character, it works.
From some quick testing, it seems to affect any Unicode characters in the Supplementary Multilingual Plane (U+10000 - U+1FFFF) - odometerCopper Contributor
I am experiencing the same issue. We have been using the MS Teams API to send messages that include emojis, but recently our clients have started complaining that the emojis are not working. Upon investigation, we discovered that the problem is caused by having emojis in the message body, which is resulting in a POST failure. This issue seems to occur for both emojis and their unicodes. To demonstrate, we tried sending two messages using cURL commands, one with an emoji unicode and another with a simple checkmark, and both resulted in failures:
curl -H 'Content-Type: application/json' -d '{"text": "😂"}' webhook_url; curl -H 'Content-Type: application/json' -d '{"text": ":white_heavy_check_mark:"}' webhook_url;