1

Description: We are having the technical difficulties to route the public folder hierarchy if there is a Journal folder, and we are thinking the workaround to use grapy API to do this, but didn't find the information to use Graph API to access the public folder, anyone can share more information would be appreciated.

Environment: Exchange online public folder. And there is one journal folder and one sub folder under the journal folder.

Method: Folder.FindFolders EWS API to route the public folder hierarchy.

Exception: error code: ErrorCannotUseFolderIdForItemId, error: Microsoft.Exchange.WebServices.Data.ServiceResponseException: Expected an item Id but received a folder Id.

Following is the sample code:

        public static void GetPublicFolders(Folder parentFolder, int pageSize, int offset, string parentFolderPath)
    {
        try
        {
            FindFoldersResults result;
            do
            {
                FolderView folderView = new FolderView(pageSize, offset);
                folderView.Traversal = FolderTraversal.Shallow;
                result = parentFolder.FindFolders(folderView);
                foreach (Folder folder in result)
                {
                    var path = parentFolderPath + @"\" + folder.DisplayName;
                    System.Console.WriteLine(path);

                    GetPublicFolders(folder, pageSize, 0, path);
                }
                offset += pageSize;
            }
            while (result.MoreAvailable);
        }
        catch (Exception ex)
        {
            System.Console.WriteLine(ex);
        }
    }

Thank you. Long

4

1 回答 1

0

修复正在推出!

这是由 的Microsoft Exchange WebServices(EWS)引起的问题Office365

根据微软的说法,他们在服务器端发现了故障。看看DavsterGitHub 上(一位 MS 开发人员)的评论(GitHub - EWS MangedAPI 问题 204)

于 2018-09-05T17:41:25.690 回答