Title: How to restore a Deleted Calendar Event Using Graph API · Issue #2561 · microsoftgraph/msgraph-sdk-java · GitHub
Open Graph Title: How to restore a Deleted Calendar Event Using Graph API · Issue #2561 · microsoftgraph/msgraph-sdk-java
X Title: How to restore a Deleted Calendar Event Using Graph API · Issue #2561 · microsoftgraph/msgraph-sdk-java
Description: Context We are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementation works perfectly, we are struggling t...
Open Graph Description: Context We are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementat...
X Description: Context We are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementat...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/2561
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to restore a Deleted Calendar Event Using Graph API","articleBody":"Context\nWe are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementation works perfectly, we are struggling to locate the deleted events using the Graph API.\n\n**Current EWS Implementation (Working)**\nIn EWS, we use DeleteMode.HardDelete and then search the RecoverableItemsPurges folder to move the item back to the Calendar.\n\n```\n// How we delete meeting from calendar\nif (msg instanceof MeetingMessage) {\n MeetingMessage meetingMessage = MeetingMessage.bind(service, msg.getId());\n ItemId masterId = meetingMessage.getAssociatedAppointmentId();\n if (masterId != null) {\n Appointment appointment = Appointment.bind(service, masterId);\n appointment.delete(DeleteMode.HardDelete);\n }\n}\n\n// How we restore the message\nItemView itemView = new ItemView(EwsServer.FOLDER_VIEW_PAGE_SIZE);\nitemView.setTraversal(ItemTraversal.Shallow);\n\nSearchFilter filterColl = new SearchFilter.SearchFilterCollection(\n LogicalOperator.And, \n new SearchFilter.IsEqualTo(ItemSchema.Subject, message.getSubject()),\n new SearchFilter.IsEqualTo(EmailMessageSchema.Sender, message.getSender().getAddress())\n);\n\nFindItemsResults\u003cItem> deletedItems = server.getExchangeService()\n .findItems(WellKnownFolderName.RecoverableItemsPurges, filterColl, itemView);\n\nif (deletedItems.getItems().size() > 0) {\n for (Item item : deletedItems.getItems()) {\n item.move(WellKnownFolderName.Calendar);\n break;\n }\n}\n```\n\n\n**Problem: Graph API Implementation (Not Working)**\nWhen using the Graph SDK, we cannot find the event in the recoverable items folders after a deletion.\n\nDeletion code:\n```\ngraphClient.users().byUserId(mailboxBeingScanned)\n .calendar().events().byEventId(eventId)\n .permanentDelete().post();\n//we have tried delete method as this as well\ngraphClient.users().byUserId(mailboxBeingScanned)\n .calendar().events().byEventId(eventId)\n .delete();\n```\n\n\nAttempted recovery code:\nWe have tried searching recoverableitemspurges, deleteditems, and recoverableitemsdeletions using the internetMessageId, but the collection always returns empty.\n\n\n```\nMessageCollectionResponse eventMessage = graphClient.users().byUserId(mailboxBeingScanned)\n .mailFolders().byMailFolderId(\"recoverableitemspurges\")\n .messages()\n .get(requestConfiguration -> {\n requestConfiguration.queryParameters.filter = \"internetMessageId eq '\u003cMN2PR13...prod.outlook.com>'\";\n });\n```\n\n**Questions**\n1) When using permanentDelete() on a Calendar Event in Graph, does it land in a different folder than it would via EWS?\n\n2) What is the correct mailFolderId or endpoint to query for items in the \"Recoverable Items\" partition specifically for Calendar events?","author":{"url":"https://github.com/raghucha","@type":"Person","name":"raghucha"},"datePublished":"2026-03-24T01:50:27Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/2561"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dc221c41-a9a6-4499-5f98-0bdad49c97fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B72:29CC9E:A4D2D:E18D9:6AF6BAD8 |
| html-safe-nonce | 4b5abfd82585f3a28db601bf5ac50f9f36a20b04f0498d321ae1286eb4e03959 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjcyOjI5Q0M5RTpBNEQyRDpFMThEOTo2QUY2QkFEOCIsInZpc2l0b3JfaWQiOiI4ODQxOTQ5OTgxODAwMDUzNDY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b3821517ccc29348a3573f40e0b0b1c25c793f379f8d79cc8807b8e8c705a9a7 |
| hovercard-subject-tag | issue:4124706848 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/2561/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c1f538962905b6669bf5d1a03dfde491cfce3b9a64c669d1232f12756fa9daa8/microsoftgraph/msgraph-sdk-java/issues/2561 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1f538962905b6669bf5d1a03dfde491cfce3b9a64c669d1232f12756fa9daa8/microsoftgraph/msgraph-sdk-java/issues/2561 |
| og:image:alt | Context We are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | raghucha |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8dfae1499400ee498ab0f86538d1c034e6c1b4f51c63ecade775c3b0894e3379 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 103300409 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 103300409 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ee168845eb2be91203b179104ac9977fe4ea69a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width