Skip to main content
deleted 106 characters in body
Source Link
H. Pauwelyn
  • 14.4k
  • 28
  • 93
  • 164

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.

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.

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.

Source Link

Get another User events using MS Graph API

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.