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; } 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; } andAnd according to guide iI should request
GET /users/{id | userPrincipalName}/calendar/events
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();
graphClient.Users[id].Request(); Please explain me. Every info will be usefull.