chatMessage: setReaction
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Set a reaction to a single chatMessage or a chat message reply in a channel or a chat.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permissions for channel
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | ChannelMessage.Send |
Delegated (personal Microsoft account) | Not supported. |
Application | Not supported. |
Permissions for chat
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Chat.ReadWrite, ChatMessage.Send |
Delegated (personal Microsoft account) | Not supported. |
Application | Not supported. |
HTTP request
To set a reaction to a chatMessage in a channel:
POST /teams/{teamsId}/channels/{channelId}/messages/{chatMessageId}/setReaction
POST /teams/{teamId}/channels/{channelId}/messages/{messageId}/replies/{replyId}/setReaction
To set a reaction to a chatMessage in a chat:
POST /chats/{chatId}/messages/{chatMessageId}/setReaction
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
In the request body, supply the reactionType as unicode.
Response
If successful, this action returns a 204 No Content
response code.
Examples
Example 1: Set a reaction to a chat message
Request
POST https://graph.microsoft.com/beta/chats/chatId/messages/messageId/setReaction
{
"reactionType": "💘"
}
Response
HTTP/1.1 204 No Content
Example 2: Set a reaction to a message in a channel
Request
POST https://graph.microsoft.com/beta/teams/teamsid/channels/channelId/messages/messageId/setReaction
{
"reactionType": "💘"
}
Response
HTTP/1.1 204 No Content
Example 3: Set a reaction to a reply message
Request
POST https://graph.microsoft.com/beta/teams/teamsid/channels/channelId/messages/messageId/replies/replyId/setReaction
{
"reactionType": "💘"
}
Response
HTTP/1.1 204 No Content
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기