fileAttachment 资源类型fileAttachment resource type

重要说明: Microsoft Graph 中 /beta 版本下的 API 是预览版,可能会发生变化。Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

附加到事件消息Outlook 任务发布(如文本文件或 Word 文档) 的文件。A file (such as a text file or Word document) attached to an event, message, Outlook task, or post. ContentBytes属性将包含 base64 编码的文件的内容。The contentBytes property contains the base64-encoded contents of the file.

创建文件附件时,在请求正文中包括以下内容:When creating a file attachment, include the following in the request body:

  • "@odata.type": "#microsoft.graph.fileAttachment"
  • 必要属性名称contentBytesThe required properties name and contentBytes.

派生自 附件Derived from attachment.

方法Methods

方法Method 返回类型Return Type 说明Description
GetGet fileAttachmentfileAttachment 读取 fileattachment 对象的属性和关系。Read properties and relationships of fileAttachment object.
删除Delete None 删除 fileAttachment 对象。Delete fileAttachment object.

属性Properties

属性Property 类型Type 说明Description
contentBytescontentBytes BinaryBinary 文件的 Base64 编码内容。The base64-encoded contents of the file.
contentIdcontentId StringString 获取 Exchange 存储中的附件 ID。The ID of the attachment in the Exchange store.
contentLocationcontentLocation StringString 对应于附件内容所在位置的统一资源标识符 (URI)。The Uniform Resource Identifier (URI) that corresponds to the location of the content of the attachment.
contentTypecontentType StringString 附件的内容类型。The content type of the attachment.
idid StringString 附件 ID。The attachment ID.
isInlineisInline 布尔Boolean 如果是内嵌附件则设置为 true。Set to true if this is an inline attachment.
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次修改附件的日期和时间。The date and time when the attachment was last modified.
namename StringString 表示显示在表示嵌入的附件的图标下方的文本的名称。该名称不必是实际的文件名。The name representing the text that is displayed below the icon representing the embedded attachment.This does not need to be the actual file name.
sizesize Int32Int32 附件大小,以字节为单位。The size in bytes of the attachment.

RelationshipsRelationships

None

JSON 表示形式JSON representation

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

{
  "contentBytes": "binary",
  "contentId": "string",
  "contentLocation": "string",
  "contentType": "string",
  "id": "string (identifier)",
  "isInline": true,
  "lastModifiedDateTime": "String (timestamp)",
  "name": "string",
  "size": 1024
}