Pages Menu
TwitterRssFacebook

Posted by on Oct 17, 2022 in Microsoft Teams

You’ll soon be able to set reactions on Teams message via Graph API, and use ANY emoji! πŸ˜ŽπŸ¦Ήβ€β™€οΈπŸ™€πŸ€―

You’ll soon be able to set reactions on Teams message via Graph API, and use ANY emoji! πŸ˜ŽπŸ¦Ήβ€β™€οΈπŸ™€πŸ€―

A new set of Microsoft Graph APIs have been launched that allow developers to programatically set reactions to Microsoft Teams channel and chat messages.

Reactions typically include things like liking πŸ‘, loving ❀, laughing and so on.

But now, you can choose your OWN reaction by providing any valid emoji unicode character!

These new APIs tie in with newly announced functionality in Microsoft Teams that allows any emoji character to be used as the reaction, and which are expected to GA in November.

Where are these new APIs?

There are two places you can use this new functionality: chat messages and channel chat messages. Both work in the same way and can be applied to both messages or their replies. There is a corresponding “unset” for each set as well.

Set Reaction

Once you have the ID of the message or reply you want to react to, it’s a simple POST command set apply the reaction. Notice that the body of the message allows a complete free-from in which character is applied:

POST https://graph.microsoft.com/beta/chats/{chatId}/messages/{messageId}/setReaction
{
  "reactionType": "😻"
}

Undo the Set Reaction

If you change your mind, you can “unset” your reaction as well, by calling another endpoint and passing exactly the same character:

POST https://graph.microsoft.com/beta/chats/{chatId}/messages/{messageId}/unsetReaction
{
  "reactionType": "😻"
}

Once the functionality shows up in Microsoft Teams, you can then expect these emojis to show in the client.

The reactions also show up in the GET response body when retrieving the message:

Be aware though that the reactionType property now contains a mixture of Unicode characters (like the one in the screenshot above) and the original reaction types which are strings (like, angry, sad, laugh, heart, surprised).

More information on the official docs pages: Set Reaction | Unset Reaction

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.