Office 365 Calendar API仅检索10条记录

时间:2015-09-15 05:56:05

标签: calendar office365 outlook-restapi

尝试从Office 365日历中获取事件时出现问题 问题是我只能获取10个事件和eventsResult.MorePagesAvailable总是为假

我在一个月内举行了50多次会议,而且eventResult只获得了10次

获取事件的代码: -

 var eventSource = service.Me.Calendar.Events;

 if (!String.IsNullOrEmpty(calendarId))
                {
  eventSource = service.Me.Calendars[calendarId].GetCalendarView(lowerBounday, upperBoundary);
   // lowerBounday - Start Date for fetching events from calendar
   // upperBoundary - End Date for fetching events from calendar

  var eventsResult = await (from i in eventSource orderby i.Start select i).ExecuteAsync();
 }

获取所有日历的问题相同 我在Office 365中有更多10个日历,但仍然只有10个与MorePagesAvailable为假。 获取所有日历的代码: -

 var allCalendars = await service.Me.Calendars.ExecuteAsync();
 bool checkNextPage = false;
                do
 {
  if (checkNextPage && allCalendars.MorePagesAvailable)
  {
   allCalendars = await allCalendars.GetNextPageAsync();
  }
  foreach (ICalendar calendar in allCalendars.CurrentPage)
  {
   lock (calendars)
   {
    calendars.Add(new CalendarData(calendar.Name, calendar.Id)
    {
     HasWriteAccess = true,
     IsFreeBusy = true
    });
   }
  }
  if(!checkNextPage)
   checkNextPage = true;
 } while(allCalendars.MorePagesAvailable)

我们正在使用Microsoft.Office365 DLL的版本1.0.35来获取此代码。 它工作正常,直到2015年9月10日。 API有什么变化,或者我们遗漏了什么? 任何帮助都会非常感激。

2 个答案:

答案 0 :(得分:0)

原来这是我们工程师正在研究的一个已知问题。很抱歉给您带来不便!

更新:修复程序正在管道中。我在租户的回复中看到了@odata.nextLink,所以看起来它正在投入生产中的服务器。

答案 1 :(得分:-1)

10是默认号码。你需要使用像https://outlook.office.com/api/v1.0/me/messages这样的东西吗?$ top = number number = 5,10 ...你想要多少个事件。更多详情:https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#UseODataqueryparametersPageresults