outlookCategory 资源类型outlookCategory resource type


Microsoft Graph 中/beta的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

表示用户可以对 Outlook 项目(如邮件和事件)进行分组的类别依据。Represents a category by which a user can group Outlook items such as messages and events. 在 Outlook 中, 用户定义了主列表中的类别, 并且可以将这些用户定义的一个或多个类别应用于项目。In Outlook, the user defines categories in a master list, and can apply one or more of these user-defined categories to an item.

使用 REST API,可以在用户类别的主列表中创建和定义类别。Using the REST API, you can create and define categories in the master list of categories for a user. 还可以获取主类别列表获取特定类别更新与类别相关联的颜色,或删除类别。You can also get this master list of categories, get a specific category, update the color associated with a category, or delete a category. 可以通过将类别的 displayName 属性分配给项目的 categories 集合,将类别应用到项目。You can apply a category to an item by assigning the displayName property of the category to the categories collection of the item. 可分配类别的资源包括联系人事件邮件outlookTask帖子Resources that can be assigned categories include contact, event, message, outlookTask, and post.

每个类别都有 2 个属性:displayNamecolorEach category is attributed by 2 properties: displayName and color. displayName 值在用户的主列表中必须是唯一的。The displayName value must be unique in a user's master list. 然而,color 不一定是唯一的;主列表中的多个类别可以映射到相同颜色。The color however does not have to be unique; multiple categories in the master list can be mapped to the same color. 可以在用户的主列表中将多达 25 种不同的颜色映射到类别。You can map up to 25 different colors to categories in a user's master list.


属性Property 类型Type 说明Description
displayNamedisplayName StringString 标识用户邮箱中的类别的唯一名称。A unique name that identifies a category in the user's mailbox. 在创建类别后,名称将无法更改。After a category is created, the name cannot be changed. 只读。Read-only.
colorcolor StringString 预先设定的颜色常数,它表示类别的特征,并映射到 25 种预定义颜色中的一种。A pre-set color constant that characterizes a category, and that is mapped to one of 25 predefined colors. 请参阅下面的备注。See the note below.

注意color 的可能值为预设的常数,如 Nonepreset0preset1Note The possible values for color are pre-set constants such as None, preset0 and preset1. 每个预设定的常数会被进一步映射到一种颜色;实际颜色取决于显示类别的 Outlook 客户端。Each pre-set constant is further mapped to a color; the actual color is dependent on the Outlook client that the categories are being displayed in. 下表显示了 Outlook(桌面客户端)中映射到每个预设常数的颜色。The following table shows the colors mapped to each pre-set constant for Outlook (desktop client).

预设常数Pre-set constant Outlook 中映射的颜色Color mapped to in Outlook
NoneNone 没有映射的颜色No color mapped
Preset0Preset0 红色Red
Preset1Preset1 橙色Orange
Preset2Preset2 褐色Brown
Preset3Preset3 黄色Yellow
Preset4Preset4 绿色Green
Preset5Preset5 青色Teal
Preset6Preset6 橄榄绿Olive
Preset7Preset7 蓝色Blue
Preset8Preset8 紫色Purple
Preset9Preset9 蔓越橘色Cranberry
Preset10Preset10 青灰色Steel
Preset11Preset11 深青灰DarkSteel
Preset12Preset12 灰色Gray
Preset13Preset13 深灰DarkGray
Preset14Preset14 黑色Black
Preset15Preset15 深红DarkRed
Preset16Preset16 暗橙DarkOrange
Preset17Preset17 深褐DarkBrown
Preset18Preset18 深黄DarkYellow
Preset19Preset19 深绿DarkGreen
Preset20Preset20 深青DarkTeal
Preset21Preset21 深橄榄色DarkOlive
Preset22Preset22 深蓝DarkBlue
Preset23Preset23 深紫DarkPurple
Preset24Preset24 深蔓越橘色DarkCranberry

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

  "color": "String",
  "displayName": "String"


方法Method 返回类型Return Type 说明Description
List categoriesList categories outlookCategory 集合outlookCategory collection 获取为用户定义的所有类别。Get all the categories that have been defined for the user.
Get categoryGet category outlookCategoryoutlookCategory 获取指定的 outlookCategory 对象的属性和关系。Get the properties and relationships of the specified outlookCategory object.
CreateCreate outlookCategoryoutlookCategory 在用户主类别列表中创建 outlookCategory 对象。Create an outlookCategory object in the user's master list of categories.
UpdateUpdate outlookCategoryoutlookCategory 更新指定 outlookCategory 对象的可写属性 colorUpdate the writable property, color, of the specified outlookCategory object.
删除Delete None 删除指定的 outlookCategory 对象。Delete the specified outlookCategory object.