Get all calendars from root RRS feed

  • Question

  • Hi guys,

    I am developing an integration with EWS based on php. I am using a library I found https://github.com/jamesiarmes/php-ews

    In my case users have various calendars hanging from the root, I get access to the default calendar by this:

    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
    $response = $ews->FindFolder($request);

    I also get access to shared calendars by this:

    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::PUBLIC_FOLDERS_ROOT;
    $response = $ews->FindFolder($request);

    But I am getting crazy to get all calendars hanging from the root. If I asked for all folders on the root I don't get those calendars. What service and params do I need to send to get all calendars from the root?


    Thursday, July 10, 2014 3:18 PM

All replies

  • C# ews code to get all child folders from top of the information store:

    // We are going to get the top of the info store and list all of the child folders in it.
    Folder parentfolder = Folder.Bind(es, WellKnownFolderName.MsgFolderRoot);
    Console.WriteLine("The " + parentfolder.DisplayName + " has " + parentfolder.ChildFolderCount + " child folders.");
    // Now we print out each child foders name.           
    int folderCnt = 0;
    foreach (var item in parentfolder.FindFolders(new FolderView(100)))
    Console.WriteLine("{0}: {1}", folderCnt, item.DisplayName);

    Friday, July 11, 2014 6:06 AM
  • If you make a FindFolder Request set the Traversal to Deep and use a restriction on the FolderClass to IPF.Appointment that should return all the Calendar folders in a mailbox eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
          <t:RequestServerVersion Version="Exchange2013_SP1" />
          <m:FindFolder Traversal="Deep">
            <m:IndexedPageFolderView MaxEntriesReturned="1000" Offset="0" BasePoint=
    "Beginning" />
                <t:FieldURI FieldURI="folder:FolderClass" />
                  <t:Constant Value="IPF.Appointment" />
              <t:DistinguishedFolderId Id="msgfolderroot" />

    Friday, July 11, 2014 10:15 AM