My application uses the Microsoft Graph API to do some calendar events management. My app authenticates as the user and so acts on the user's own calendar only.
The feature I am working on requires me to re-instate a previously deleted event for which the user was an attendee (not the organizer). I have an archived copy of the event and all its details.
When I use the Create Event endpoint, the server ignores whatever I set as organizer and isOrganizer and always forces the calendar owner to be the organizer. This is a problem of course because the user was just an attendee and I need the re-created event to reflect that. Furthermore, the server will unfortunately send out invites from my user to the other attendees when I re-create the event.
Given an initial (deleted and archived) event that looks like this (removed some keys):
{ "attendees": [ { "emailAddress": { "address": "_ORGANIZER_EMAIL_", "name": "_ORGANIZER_NAME_" }, "status": { "response": "none", "time": "0001-01-01T00:00:00Z" }, "type": "required" }, { "emailAddress": { "address": "_USER_EMAIL_", "name": "_USER_NAME_" }, "status": { "response": "none", "time": "0001-01-01T00:00:00Z" }, "type": "required" } ], "body": { "content": "_HTML_CONTENT_", "contentType": "html" }, "bodyPreview": "_TEXT_PREVIEW_", "[email protected]": "https://graph.microsoft.com/v1.0/users('_USER_EMAIL_')/calendars('_USER_CALENDAR_ID_')/$ref", "[email protected]": "https://graph.microsoft.com/v1.0/users('_USER_EMAIL_')/calendars('_USER_CALENDAR_ID_')", "isOrganizer": false, "organizer": { "emailAddress": { "address": "_ORGANIZER_EMAIL_", "name": "_ORGANIZER_NAME_" } } } I tried to re-create the calendar event by hitting (omitted some fields):
POST users/_USER_EMAIL_/calendar/events { // These two fields are completely ignored "isOrganizer": false, "organizer": { "emailAddress": { "address": "_ORGANIZER_EMAIL_", "name": "_ORGANIZER_NAME_" } } // Trying to force-set organizer, taken from this answer to a very similar Q // 2 years ago: https://stackoverflow.com/a/76354749/3977061 "singleValueExtendedProperties": [ {"id": "String 0x0042", "value": "_ORGANIZER_NAME_"}, {"id": "String 0x0065", "value": "_ORGANIZER_EMAIL_"}, {"id": "String 0x0064", "value": "SMTP"}, {"id": "Boolean {00020329-0000-0000-C000-000000000046} Name urn:schemas:calendar:isorganizer", "value": "false"} ] } No matter what I do, the server will not allow me to properly set the original organizer. The response has conflicting keys
{ ... "isOrganizer": true, "organizer": { "emailAddress": { "address": "_ORGANIZER_EMAIL_", "name": "_ORGANIZER_NAME_" } }, } So organizer is correct because of the singleValueExtendedProperties setting; however, isOrganizer suggests that my user is still the event organizer. On my user's calendar, it says "You're the Organizer", and invites are sent out as if the user just organized the event.
I'm trying to find out basically how can I import an event and set an external organizer.
Alternatively, is there a way to tell the server to not send out notifications to attendees when I re-create the event?
Related Questions: