1

I am working on Outlook Calendar Events integration using Microsoft Graph Api in Xamarin forms. Also, i have done with the Authentication part but i have some queries related to fetching of Calendar Events.

Q. I am able to fetch Calendar Events through my code , but its limited to "10" events only. I am not able to fetch all my outlook calendar events.

Client = new GraphServiceClient("https://graph.microsoft.com/v1.0/",
                      new DelegateAuthenticationProvider(async (requestMessage) =>
                      {        
                          requestMessage.Headers.Authorization = new AuthenticationHeaderValue("bearer", authResult.AccessToken);                       
                      }));
                var events = await Client.Me.Calendar.Events.Request().GetAsync();                             
                var appointmentList = events.ToList();
                foreach (var appointment in appointmentList)
                {
                    Random randomTime = new Random();
                    Meetings.Add(new Model.Meeting()
                    {
                        From = Convert.ToDateTime(appointment.Start.DateTime).ToLocalTime(),
                        To = Convert.ToDateTime(appointment.End.DateTime).ToLocalTime(),
                        EventName = appointment.Subject,
                        Color = colorCollection[randomTime.Next(9)]
                    });
                }

Can anyone help me out to fetch all the calendar events??

Thanks.

  • According to https://stackoverflow.com/questions/48686471/is-microsoft-graph-api-calendarview-limited-to-a-single-month-how-to-get-all-ev , you should be able to add `&$top=1000` url parameter to make that happen – Saamer Feb 04 '20 at 17:46
  • Its not working for me. I am using MS Graph Api url . And , after setting the GET url ...its throwing Exception for Endtime and Starttime. Do you have any other solution ??? – Rohan_fulzele Feb 06 '20 at 11:36
  • @Rohan_fulzele About getting all Calendar Events, I find one article that you can take a look:https://devblogs.microsoft.com/xamarin/lets-schedule-meeting/ – Cherry Bu - MSFT Feb 14 '20 at 06:35

0 Answers0