I am using below url for calls to ms graph api. Now I migrate to use the nuget Microsoft.Graph (GraphServiceClient) instead. In ms graph api explorer the call is working as expected but not with the nuget. Any ideas?
I have tried some variants now but can´t get the same answer.
Request:
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/calendar/calendarView?startDateTime=2021-08-19T09:22:00.6654083Z&endDateTime=2021-08-30T09:22:00.6654083Z&showAs=free&$select=showAs,start,end&$top=1000
My code attempt that are not working is
QueryOption startDateTime = new QueryOption("startDateTime", startDate.ToString("o"));
QueryOption endDateTime = new QueryOption("endDateTime", endDate.ToString("o"));
List<Option> options = new List<Option>();
options.Add(startDateTime);
options.Add(endDateTime);
var items= await _graphServiceClient
.Users[profileName]
.Calendar
.CalendarView
.Request(options)
.GetAsync();