命名空间:microsoft.graph
用户事件、邮件或帖子中附加的文件(例如文本文件或 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"
}