fileAttachment 资源类型

命名空间:microsoft.graph

重要

Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

注意

应更新将此功能与Outlook一起使用的现有应用,Outlook弃用的任务。 有关详细信息微软待办请参阅公共预览版中的 API。

文件 (,例如附加到用户事件消息Outlook任务或帖子的文本文件或 Word 文档)

创建文件附件时,在请求正文中包括以下内容:

  • "@odata.type": "#microsoft.graph.fileAttachment"
  • 必要属性 名称contentBytes

派生自 附件

备注

确保先使用 base64 为文件内容编码,然后再将其分配到 contentBytes

方法

方法 返回类型 说明
Get fileAttachment 读取 fileAttachment 对象的属性、关系或原始内容。
删除 删除 fileAttachment 对象。

属性

属性 类型 说明
contentBytes Edm.Binary 文件的 Base64 编码内容。
contentId String 获取 Exchange 存储中的附件 ID。
contentLocation String 请勿使用此属性,因为它不受支持。
contentType String 附件的内容类型。
id String 附件 ID。
isInline Boolean 设置为 true 如果这是内联附件。
lastModifiedDateTime DateTimeOffset 上次修改附件的日期和时间。
name String 表示显示在表示嵌入的附件的图标下方的文本的名称。该名称不必是实际的文件名。
size Int32 附件大小,以字节为单位。

关系

无。

JSON 表示形式

下面是资源的 JSON 表示形式。

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