更新 chatMessageUpdate chatMessage

更新 chatMessage 对象。Update a chatMessage object. 只能 更新 chatMessagepolicyViolation 属性。Only the policyViolation property of a chatMessage can be updated.

PermissionsPermissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) 不支持。Not supported.
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application Chat.UpdatePolicyViolation.All 用于聊天消息。Chat.UpdatePolicyViolation.All for a chat message.
ChannelMessage.UpdatePolicyViolation.All 用于频道消息。ChannelMessage.UpdatePolicyViolation.All for a channel message.

HTTP 请求HTTP request

PATCH /teams/(team-id)/channels/{channel-id}/messages/{message-id}

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.
Content-TypeContent-Type application/json. Required.application/json. Required.

请求正文Request body

在请求正文中,提供 chatMessage 对象的 JSON 表示形式,仅指定 policyViolation 属性。In the request body, supply a JSON representation of a chatMessage object, specifying only the policyViolation property.

响应Response

如果成功,此方法将返回 200 OK 响应。If successful, this method returns a 200 OK response.

示例Example

请求Request

下面是请求更新 Microsoft Teams 频道消息中的 policyViolation 属性的示例。The following is an example of the request to update the policyViolation property on a Microsoft Teams channel message.

PATCH https://graph.microsoft.com/v1.0/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
Content-Length: 248

{
  "policyViolation": {
    "policyTip": {
      "generalText" : "This item has been blocked by the administrator.",
      "complianceUrl" : "https://contoso.com/dlp-policy-page",
      "matchedConditionDescriptions" : ["Credit Card Number"]
    },
    "verdictDetails" : "AllowOverrideWithoutJustification,AllowFalsePositiveOverride",
    "dlpAction" : "BlockAccess"
  }
}

响应Response

下面是一个响应示例。Here is an example of the response.

HTTP/1.1 200 OK