如何使用Microsoft图形API从Office 365还原已删除的邮件 [英] How to restore deleted mail from office 365 using Microsoft graph api

查看:101
本文介绍了如何使用Microsoft图形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中没有还原方法(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(最后活动父FolderId)属性 https://blogs.technet.microsoft.com/exchange/2017/06/13/announcing-original-folder-item-recovery/.例如,将其用于垃圾箱中的物品上

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,因此您需要额外的代码,在

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图形API从Office 365还原已删除的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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