如何使用 Microsoft graph api 从 Office 365 恢复已删除的邮件 [英] How to restore deleted mail from office 365 using Microsoft graph api

查看:33
本文介绍了如何使用 Microsoft graph api 从 Office 365 恢复已删除的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想恢复我们使用 Microsoft graph api 删除的邮件.

I want to restore a mail which we delete using Microsoft graph api.

我没有找到任何 api 来使用 api 恢复或恢复已删除的邮件.

I don't find any api to restore or recoved a deleted mail using apis.

推荐答案

Graph API 中没有 restore 方法(MAPI 或 EWS 中也没有).当一个项目在 Exchange 中被删除时,它只会被移动到邮箱中的另一个文件夹中,直到该项目的保留期到期,然后 MFA(托管文件夹助理)将删除这些项目.

There is no restore method in the Graph API (there also isn't one in MAPI or EWS). When an Item gets deleted in Exchange it just gets moved into another folder in the Mailbox up until the time the retention period of the Item expires then the MFA(Managed Folder Assistant) deletes the Items.

例如,要恢复垃圾箱中的项目,您需要查询垃圾箱中的项目,例如

So for example to restore an Item that was in the dumpster you would need to query for the Item in the dumpster like

 https://graph.microsoft.com/v1.0/users('user@mailbox.com')/MailFolders/recoverableitemsDeletions/messages/

然后您可以使用 https://docs.microsoft.com/en-us/graph/api/message-move?view=graph-rest-1.0&tabs=http

如果您想将其移回原来被删除的位置,您需要使用 LAPFID(上一个活动父文件夹 ID)属性 https://blogs.technet.microsoft.com/exchange/2017/06/13/announcing-original-folder-项目恢复/ .例如,在垃圾箱中的物品上使用

If you wanted to move it back to the original location it was deleted from you would need to use the LAPFID (Last Active Parent FolderId) property https://blogs.technet.microsoft.com/exchange/2017/06/13/announcing-original-folder-item-recovery/ . Eg to get that on items in the dumpster use

https://graph.microsoft.com/v1.0/users('user@mailbox.com')/MailFolders/recoverableitemsDeletions/messages/?$select=Subject&$Top=10&$expand=SingleValueExtendedProperties($filter%3DId%20eq%20'Binary%200x348A')

使用 LAPFID 有点棘手,因为它只是一个部分 folderId,因此您需要额外的代码,在 https://gsexdev.blogspot.com/2018/10/using-lapfid-last-active-parent.html

Using the LAPFID is a little tricky as it's only a partial folderId so you need extra code for that, there are a few examples of using it in https://gsexdev.blogspot.com/2018/10/using-lapfid-last-active-parent.html

这篇关于如何使用 Microsoft graph api 从 Office 365 恢复已删除的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆