删除附件

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

先决条件

要执行此 API,需要以下范围之一:

  • 如果访问邮件中的附件:Mail.ReadWrite
  • 如果访问事件中的附件:Calendars.ReadWrite
  • 如果访问组事件或帖子中的附件:Group.ReadWrite.All

HTTP 请求

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

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

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

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

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

DELETE /me/calendargroup/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendargroup/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 . Required.

请求正文

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

响应

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

示例

请求

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

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

下面是一个响应示例。

HTTP/1.1 204 No Content