删除附件
命名空间:microsoft.graph
从用户日历事件、邮件或组帖子中删除附件。
此 API 可用于以下国家级云部署。
全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
权限
根据附件附加到的资源 (事件、 消息、 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 | 持有者 {token}。 必填。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法返回 204 No Content
响应代码。 它不会在响应正文中返回任何内容。
示例
请求
以下示例显示了删除事件附件的请求。
DELETE https://graph.microsoft.com/v1.0/me/events/{id}/attachments/{id}
响应
以下示例显示了相应的响应。
HTTP/1.1 204 No Content
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈