3

Need to create an event where current user is not the organizer. I tried with the following code that I'm using to create the event:

var eventsEndPoint=New Uri("https://graph.microsoft.com/v1.0/users/johndoe@some.com/events");

var postBody="{'Subject':'Testing Organizer - 12','Location':{'DisplayName':'Some place'}," +
        "'Start': {'DateTime': '2016-07-15T15:00:00.0000000', 'TimeZone':'UTC'}," +
        "'End': {'DateTime': '2016-07-15T15:30:00.0000000', 'TimeZone':'UTC'},"+
        "'Body':{'Content': 'This is a test of Grap API.', 'ContentType':'Text'},"+
        "'IsOrganizer':'False','Organizer':{'EmailAddress': "+"{'Address':'organizer@some.com'} }}";

var createBody = new StringContent(postBody, system.Text.Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync(eventsEndPoint, createBody);

Event gets created but no matter that IsOrganizer=false and Organizer is set to different user than the one the event is created for (johndoe@some.com) response always show that IsOrganizer gets set to true and Organizer user is the same user and not the one set at Organizer property at the request.

Is it possible to set a different organizer using Graph?

danfer
  • 371
  • 1
  • 3
  • 10

1 Answers1

5

It sounds like you are attempting to use delegates (aka "send on behalf of"). At the moment delegation isn't supported by Graph. Your events will always be created with the authenticated account as the organizer.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • Thanks Marc, indeed, it seems such a functionality isn't available. I found that user that creates event is always organizer. If add attendees, each one gets its own event, and in this case, organizer is the creator user – danfer Jul 15 '16 at 02:54
  • Marc, has there been any update on using delegates since 2016? I too, find that the following code has no impact. "'IsOrganizer':'False','Organizer':{'EmailAddress': "+"{'Address':'organizer@some.com'} }} – Martin Sommer Jan 29 '18 at 20:12
  • Hi Mark, any update on the above? Is there any way for us to create an event and set a different Organizer? – Rafa Ayadi Nov 23 '21 at 14:37