2

I`m using https://github.com/microsoftgraph/aspnet-snippets-sample sample to access my AD using Graph API, but I need to get events of specific user. There are only sample for getting my events:

public async Task<List<ResultsItem>> GetMyEvents(GraphServiceClient graphClient) { List<ResultsItem> items = new List<ResultsItem>(); // Get events. IUserEventsCollectionPage events = await graphClient.Me.Events.Request().GetAsync(); if (events?.Count > 0) { foreach (Event current in events) { items.Add(new ResultsItem { Display = current.Subject, Id = current.Id }); } } return items; } 

And according to guide I should request

GET /users/{id | userPrincipalName}/calendar/events 

To access another user events, but how? There is no possibility to get events from Users prop:

graphClient.Users[id].Request(); 

Please explain me. Every info will be usefull.

1 Answer 1

3

You can get to the events from the users property:

var events = await graphClient.Users[userid].Events.Request().GetAsync(); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.