删除附件

命名空间:microsoft.graph

从用户日历事件、邮件或组帖子中删除附件。

权限

根据附件附加到的资源 (事件、邮件 、outlookTask 或 post ) 以及请求的权限类型 (委派或应用程序) ,下表中指定的权限是调用此 API 所需的最低权限。 若要了解其他信息, 特权权限之前要特别小心,在"权限" 中搜索

支持的资源 委派(工作或学校帐户) 委派(个人 Microsoft 帐户) 应用程序
事件 Calendars.ReadWrite Calendars.ReadWrite Calendars.ReadWrite
邮件 Mail.ReadWrite Mail.ReadWrite Mail.ReadWrite
帖子 Group.ReadWrite.All 不支持 不支持

HTTP 请求

用户的默认日历中的事件附件。

DELETE /me/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/events/{id}/attachments/{id}

DELETE /me/calendar/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendar/events/{id}/attachments/{id}

属于用户的指定日历中的事件的附件。

DELETE /me/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendars/{id}/events/{id}/attachments/{id}

属于用户的默认 calendarGroup日历 中的 事件 附件。

DELETE /me/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendars/{id}/events/{id}/attachments/{id}

属于用户的 calendarGroup日历 中的 事件 附件。

DELETE /me/calendargroups/{id}/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendargroups/{id}/calendars/{id}/events/{id}/attachments/{id}

用户邮箱中的 邮件 附件。

DELETE /me/messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/messages/{id}/attachments/{id}

用户邮箱的顶级 mailFolder 中包含的 邮件 附件。

DELETE /me/mailFolders/{id}/messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/attachments/{id}

用户邮箱的 mailFolder 的子文件夹中包含的 邮件 附件。下面的示例显示了一个嵌套级别,但邮件可能位于子级的子级中,诸如此类。

DELETE /me/mailFolders/{id}/childFolders/{id}/.../messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/mailFolders/{id}/childFolders/{id}/messages/{id}/attachments/{id}

属于组的 对话线程 中的 帖子 附件。

DELETE /groups/{id}/threads/{id}/posts/{id}/attachments/{id}
DELETE /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/attachments/{id}

请求标头

名称 类型 说明
Authorization string Bearer {token}。必需。

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法返回 204 No Content 响应代码。它不在响应正文中返回任何内容。

示例

请求

下面的示例展示了用于删除事件的附件的请求。

DELETE https://graph.microsoft.com/v1.0/me/events/{id}/attachments/{id}
响应

下面是一个响应示例。

HTTP/1.1 204 No Content