Graph API : delete calendar events without putting them in trash bin

CHATILLON Laurent 0 Reputation points
2023-01-16T08:39:12.2166667+00:00

Hello,

I'm writing a program that uses using Graph API.
Every day, this program deletes and recreates calendar events.

It works fine, except a problem : all the removed calendar events go to the trash bin.

Users are complaining beacause each day, they have dozens of removed calendar events in their trash bin.

So my question is : Is there a way to remove a calendar event with API Graph, without having them in the trash bin ?

Thanks for your help,

Laurent

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points
    2023-01-16T23:29:41.5166667+00:00

    Hi @CHATILLON Laurent

    As per my knowledge, when you delete calendar event then the deleted item mail folder will contain an item of @odata.type #microsoft.graph.eventMessageRequest.

    Use this DELETE /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id} Graph API endpoint the deleted item mail folder messages from your user's mailbox.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.