更新 inferenceclassificationoverrideUpdate inferenceclassificationoverride

命名空间:microsoft.graphNamespace: microsoft.graph

按指定内容更改替代的 ClassifyAs 字段。Change the classifyAs field of an override as specified.

不能在 inferenceClassificationOverride 示例中使用 PATCH 更改任何其他字段。You cannot use PATCH to change any other fields in an inferenceClassificationOverride instance.

如果发件人的替代存在,并且发件人更改了他/她的显示名称,可以使用 POST 强制更新现有替代中的名称字段。If an override exists for a sender and the sender changes his/her display name, you can use POST to force an update to the name field in the existing override.

如果发件人的替代存在,并且发件人更改了他/她的 SMTP 地址,“更新”此发件人的替代的唯一方法是:删除 现有替代,然后使用新的 SMTP 地址 创建 新替代。If an override exists for a sender and the sender changes his/her SMTP address, deleting the existing override and creating a new one with the new SMTP address is the only way to "update" the override for this sender.

权限Permissions

要调用此 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) Mail.ReadWriteMail.ReadWrite
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) Mail.ReadWriteMail.ReadWrite
应用程序Application Mail.ReadWriteMail.ReadWrite

HTTP 请求HTTP request

PATCH /me/inferenceClassification/overrides/{id}
PATCH /users/{id}/inferenceClassification/overrides/{id}

请求标头Request headers

名称Name 类型Type 说明Description
AuthorizationAuthorization stringstring Bearer {token}。必需。Bearer {token}. Required.
Content-TypeContent-Type stringstring 实体正文中的数据性质。必需。Nature of the data in the body of an entity. Required.

请求正文Request body

在请求正文中,提供 classifyAs 的新值。为了获得最佳性能,不应包括尚未更改的现有值。In the request body, supply the new value for classifyAs. For best performance you shouldn't include existing values that are not changing.

属性Property 类型Type 说明Description
classifyAsclassifyAs stringstring 指定来自特定发件人的传入邮件始终应如何分类。Specifies how incoming messages from a specific sender should always be classified as. 可能的值为: focusedotherThe possible values are: focused, other.

响应Response

如果成功,此方法在响应正文中返回 200 OK 响应代码和更新的 inferenceClassificationOverride 对象。If successful, this method returns a 200 OK response code and updated inferenceClassificationOverride object in the response body.

示例Example

请求Request

以下示例将 SMTP 地址 randiw@adatum.onmicrosoft.com 的替代从 other 更改为 focusedThe following example changes the override for the SMTP address randiw@adatum.onmicrosoft.com from other to focused.

PATCH https://graph.microsoft.com/v1.0/me/inferenceClassification/overrides/{id}
Content-type: application/json

{
  "classifyAs": "focused"
}
响应Response

下面是一个响应示例。注意:为了简单起见,可能会将此处所示的响应对象截断。将从实际调用中返回所有属性。Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json

{
  "classifyAs": "focused",
  "senderEmailAddress": {
    "name": "Randi Welch",
    "address": "randiw@adatum.onmicrosoft.com"
  },
  "id": "98f5bdef-576a-404d-a2ea-07a3cf34af4r"
}