fileAttachment 资源类型fileAttachment 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 任务公告的文件(如文本文件或 Word 文档)。A file (such as a text file or Word document) attached to a user 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.


方法Method 返回类型Return Type 说明Description
GetGet fileAttachmentfileAttachment 读取 fileAttachment 对象的属性、关系或原始内容。Read the properties, relationships, or raw contents of a fileAttachment object.
删除Delete None 删除 fileAttachment 对象。Delete fileAttachment object.


属性Property 类型Type 说明Description
contentBytescontentBytes EdmEdm.Binary 文件的 Base64 编码内容。The base64-encoded contents of the file.
contentIdcontentId StringString 获取 Exchange 存储中的附件 ID。The ID of the attachment in the Exchange store.
contentLocationcontentLocation StringString 请勿使用此属性,因为它不受支持。Do not use this property as it is not supported.
contentTypecontentType StringString 附件的内容类型。The content type of the attachment.
idid StringString 附件 ID。The attachment ID.
isInlineisInline BooleanBoolean 如果是内嵌附件则设置为 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.



JSON 表示形式JSON representation

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

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