danfer
danfer

Reputation: 381

How to create event where current user not organizer using Microsoft Graph API

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/[email protected]/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':'[email protected]'} }}";

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 ([email protected]) 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?

Upvotes: 3

Views: 2338

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33124

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.

Upvotes: 5

Related Questions