0
votes

When retrieving folders list with Outlook REST API (beta endpoint)

https://outlook.office365.com/api/beta/me/MailFolders

I get the complete list of folders. But I also get some hidden/ignored folders that are not displayed in usual Outlook clients. I would like to ignore such folders as well.

I tried to forge a request using SingleExtendedProperty and PigTagAttributeHidden

https://outlook.office365.com/api/beta/me/MailFolders?$select=Id,DisplayName,ParentFolderId,ChildFolderCount,UnreadItemCount,TotalItemCount,SingleValueExtendedProperties&$expand=SingleValueExtendedProperties($filter=(PropertyId eq 'Boolean 0x10F4'))

In the results this property is always marked as false even for these "ignored" folders.

Is there another way or fix to achieve this?

1
When you say hidden/ignored, what do you mean exactly? How were they hidden?Jason Johnston
I am on Office365. I have a folder Sync Issues with three subfolders (Conflicts, Local Failures and Server Failures) that I did not created. And I have also three hidden folders that have the names of web add-ins I developed. My colleague has also some invisible folders created by some VSTO add-ins he tested. So I guessed it is an hidden property that could had been used social.msdn.microsoft.com/Forums/vstudio/en-US/…Benoit Patra
These hidden folders with the names of your add-ins: do you know where in the folder hierarchy they reside?Jason Johnston
I sent you a dm on Twitter. I'd like to collect some more data from you offline. I will of course post the final answer here :)Jason Johnston

1 Answers

1
votes

I went through the folders reported, and none of them were hidden. Basically they fell into two categories:

  • System folders like Sync Issues and Conflicts. These aren't hidden, but OWA doesn't show them in it's folder view. OWA handles these specially. The suggestion for a REST app that wants to also handle these specially and not show them is to check the WellKnownName property. All of these have a constant value for that property, so they can be selectively filtered.
  • Add-in folders. These were created by a module extension add-in. They actually reside in a folder structure like:

    /WebExtAddIns (Hidden)
        |__/{GUID id of addin} (Hidden)
            |__/{Name of module extension tab} (Visible)
    

    The REST API includes the {Name of module extension tab} folder because it's marked visible, even though it's parent folder is hidden. I've reported this to our developers and we are investigating improving this scenario. In the meantime, you can filter these out by making sure that the ParentFolderId matches either the Id of another folder in the folder results OR the ParentFolderId of the Inbox folder.