none
Why Events From ExchangeService.getUserAvailablility() Are More Than Events From ExchangeService.findItems()

    Question

  • Dear Sir/Madam,

    On Exchange Server 2016, I created one calendar event with start time "2018-05-11 09:00 AM" and end time "2018-05-11 9:00 AM".

    Start time and end time as API parameter are "2018-05-12 23:00:00.0" and "2018-05-12 11:00:00.0".

    Result From ExchangeService.getUserAvailablility() contains above event but not in result from ExchangeService.findItems()

    Can you advise what could be the problem ?

    P.S. using ews-java-api

    Thanks,

    Tommy


    • Edited by Tommy Chu Friday, May 4, 2018 9:12 AM
    Friday, May 4, 2018 9:02 AM

All replies

  • Your need to post the code your using for FindItems as there is most likely a bug in your code.
    Sunday, May 6, 2018 11:56 PM
  • Snippet of code below :

    final ServiceResponseCollection<AttendeeAvailability> availabilityResponse =
    		                                                                           getExchangeService().getUserAvailability(Lists.transform(address,
    		                                                                                                                                    EMAIL_TO_ATTENDEE_INFO),
    		                                                                                                                    new TimeWindow(startDate,
    		                                                                                                                                   endDate),
    		                                                                                                                    AvailabilityData.FreeBusy)
    		                                                                                               .getAttendeesAvailability();
    
    		final CalendarView cView = new CalendarView(startDate, endDate);
    		cView.setPropertySet(new PropertySet(BasePropertySet.IdOnly));
    		final ServiceResponseCollection<FindItemResponse<Item>> response =
    		                                                           getExchangeService().findItems(Lists.transform(address, EMAIL_TO_CALENDAR_FOLDER),
    		                                                                                          null,
    		                                                                                          null,
    		                                                                                          cView,
    		                                                                                          null,
    		                                                                                          ServiceErrorHandling.ReturnErrors);


    • Edited by Tommy Chu Monday, May 7, 2018 7:01 AM
    Monday, May 7, 2018 2:03 AM
  • Have you tried looking in the Calendar folder of the user your trying to query and seeing if its in the Calendar ? That would be the first thing to try, the most obvious issue is probably related to TimeZone so i would suggest just making you query window for FindItems bigger.

    Cheers
    Glen

    Monday, May 7, 2018 10:24 PM
  • I believe it is in the Calendar as I could retrieve it when I made "CalendarView" for FindItems bigger. 

    Sorry, I don't understand why "TimeZone" matters. Are you saying that "TimeZone" are considered ONLY in either one API ? So, GetAttendeesAvailability works at the same "startDate" and "endDate" but FindItems didin't.



    • Edited by Tommy Chu Tuesday, May 8, 2018 2:44 AM
    Tuesday, May 8, 2018 2:41 AM
  • >>I believe it is in the Calendar as I could retrieve it when I made "CalendarView" for FindItems bigger. 

    So if that works then you have your solution but still sounds like TimeZone to me

    >>Sorry, I don't understand why "TimeZone" matters. Are you saying that "TimeZone" are considered ONLY in either one API ? So, GetAttendeesAvailability works at the same "startDate" and "endDate" but FindItems didin't.

    The TimeZone will offset the appointment forward and backwards depending on the timezone of the mailbox your dealing (which may different then what your querying it in) with I would suggest you read https://msdn.microsoft.com/en-us/library/office/dn789029%28v=exchg.150%29.aspx 

    Tuesday, May 8, 2018 4:35 AM
  • Thanks for your suggestion.

    However, I still don't understand why "TimeZone" make one API works but another fails.

    Assuming that I created and retrieved events with different "TimeZone", how inputting same "startDate" and "endDate" (Timestamp) into two different APIs cause the results differents ? If two APIs treat "TimeZone" differently, do I need to input extra parameters to let them behave consistently ?

    P.S. Calendar event above was created on Exchange OWA instead of ews-java-api


    • Edited by Tommy Chu Tuesday, May 8, 2018 6:42 AM
    Tuesday, May 8, 2018 6:41 AM