I have an Outlook add in to create a calendar event from my task pane.
Once created, I would like to delete the event in some cases. Must I use the graph api to do that? If so, I have seen in the API:
DELETE /users/{id | userPrincipalName}/events/{id}
I have the 'event id', but I need the user id (or userPrincipalName). What I can get from Office.context.mailbox.userProfile is 'displayName' & 'emailAddress'
Besides, I need a Bearer header, but how can I get that token with my add in info?
Maybe I can delete the event differently...
Thanks in advance, Diego
We don't have addin (OfficeJS) API to delete the calendar event. You can achieve this using REST API. Please check this on how to use REST APIs from Outlook Addin. You will need to use getCallbackTokenAsync() addin API to get the REST Token.