openTypeExtension 资源类型(开放扩展)openTypeExtension resource type (open extensions)

打开扩展 (之前被称为 Office 365 数据扩展) 提供轻松直接将非类型化的属性添加到 Microsoft Graph 中的资源。Open extensions (formerly known as Office 365 data extensions) provide an easy way to directly add untyped properties to a resource in Microsoft Graph.

开放扩展由 openTypeExtension 资源表示。Open extensions are represented by the openTypeExtension resource. 添加到资源的所有开放扩展都会显示在派生自 extension 抽象类型的 extensions 导航属性中。Any open extension added to a resource shows up in the extensions navigation property, which is derived from the extension abstract type. 每个扩展都有 extensionName 属性(这是所有扩展的预定义唯一可写属性)和自定义数据。Each extension has an extensionName property which is the only pre-defined, writable property for all extensions, along with your custom data.

一种有助于确保扩展名称唯一性的方法是,使用反向域名系统 (DNS) 格式,此格式依赖_用户自己的域_。例如,Com.Contoso.ContactInfoOne way to help make sure extension names are unique is to use a reverse domain name system (DNS) format that is dependent on your own domain, for example, Com.Contoso.ContactInfo. 请勿在扩展名称中使用 Microsoft 域(Com.MicrosoftCom.OnMicrosoft)。Do not use the Microsoft domain (Com.Microsoft or Com.OnMicrosoft) in an extension name.

开放扩展示例:使用开放扩展向用户添加自定义数据Open extension example: Add custom data to users using open extensions

一般可用性(GA: /v1.0 和 /beta)或预览版 (/beta) 对应版本中的以下资源支持开放扩展。Open extensions are supported by the following resources in the corresponding versions - general availability (GA: /v1.0 and /beta) or preview (/beta).

资源Resource 版本Version
管理单元Administrative unit 仅供预览Preview only
日历事件Calendar event GAGA
日历事件Group calendar event GAGA
组对话线程帖子Group conversation thread post GAGA
设备device GAGA
group GAGA
邮件message GAGA
组织organization GAGA
个人联系人Personal contact GAGA
用户user GAGA

特定于 outlook 的注意事项Outlook-specific considerations

每个打开的扩展名存在于 Outlook 的资源 (事件、 消息或个人联系人) 存储在MAPI 命名属性Each open extension present on an Outlook resource (event, message, or personal contact) is stored in a MAPI named property. 为 Outlook 创建打开扩展时,请考虑 MAPI 命名属性是用户的邮箱的有限资源。When you create open extensions for Outlook, consider that MAPI named properties are a finite resource in a user's mailbox. 在用尽用户的命名的属性配额时,您无法创建该用户的任何多命名的属性。When a user's named property quota is exhausted, you can't create any more named properties for that user. 这会导致出现异常行为依赖于对函数的命名属性的客户端。This can result in unexpected behavior from clients that rely on named properties to function.

打开扩展名创建在 Outlook 资源时,请应用以下准则:Apply the following guidelines when you create open extensions on Outlook resources:

  • 创建所需的扩展的最小数目。Create the minimum number of extensions required. 大多数应用程序应该要求不多个扩展名。Most applications should require no more than one extension. 扩展具有未定义的设置的属性或结构,因此您可以将多个值存储在一个扩展。Extensions have no set defined properties or structure, so you can store multiple values in a single extension.
  • 避免 (例如,基于用户输入等。) 来扩展命名变量的方式。Avoid naming extensions in a variable manner (such as based on user input, etc.). 打开扩展名创建新的名称之前, 的用户的邮箱中未用过的每次创建新的 MAPI 命名属性。Each time an open extension is created with a new name that has not been used in a user's mailbox before, a new MAPI named property is created. 删除扩展不会删除的命名的属性。Removing the extension does not remove the named property.

使用打开扩展名 (对于 Outlook 资源) 或扩展的属性Use open extensions (for Outlook resources) or extended properties

打开扩展是适用于大多数的方案涉及存储和访问自定义数据的建议的解决方案。Open extensions are the recommended solution for most scenarios involving storing and accessing custom data. 但是,您需要通过Microsoft Graph API 元数据访问自定义 Outlook MAPI 属性未已公开的数据,您可以使用扩展的属性和其 REST APIIf, however, you need to access custom data for Outlook MAPI properties that are not already exposed through the Microsoft Graph API metadata, you can use extended properties and its REST API. 您可以验证元数据在公开哪些属性https://graph.microsoft.com/v1.0/$metadataYou can verify which properties the metadata exposes at https://graph.microsoft.com/v1.0/$metadata.

JSON 表示形式JSON representation

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

{
  "extensionName": "string",
  "id": "string (identifier)"
}

属性Properties

属性Property 类型Type 说明Description
extensionNameextensionName 字符串String 开放类型开放扩展的唯一文本标识符。必需。A unique text identifier for an open type open extension. Required.
idid StringString 连接具有 extensionName 扩展类型的完全限定的标识符 。只读。A fully qualified identifier that concatenates the extension type with the extensionName. Read-only.

关系Relationships

None

方法Methods

方法Method 返回类型Return Type 说明Description
PostPost openTypeExtension(在现有资源实例中),或包含 openTypeExtension 对象的新 contacteventmessageopenTypeExtension (in an existing resource instance), or a new contact, event, or message that contains an openTypeExtension object 在现有的或新的资源实例中创建 openTypeExtension 对象。Create an openTypeExtension object in an existing or new resource instance.
获取Get openTypeExtensionopenTypeExtension 读取 openTypeExtension 对象的属性和关系。Read properties and relationships of openTypeExtension object.
更新Update openTypeExtensionopenTypeExtension 更新 openTypeExtension 对象。Update openTypeExtension object.
删除Delete None 删除 openTypeExtension 对象。Delete openTypeExtension object.