展望REST API - getFolders不返回所有文件夹 [英] Outlook REST API - getFolders not returning all folders

查看:223
本文介绍了展望REST API - getFolders不返回所有文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Outlook REST API。我的底线是使用节点前景教程。

的第一道命令是检索所有的文件夹在我的邮件帐户。

所以我发出此REST请求:

  GET https://outlook.office.com/api/v2.0/Me/MailFolders

而不是返回所有我的文件夹的,它只返回众所周知的文件夹:

 杂波
删除的项目
草稿
收件箱
垃圾邮件
发件箱
发送的邮件
垃圾

我失去了,说,没有,真的,所有的人都请?

的查询参数什么的

更新

我尝试了不同的电子邮件帐户,而且我还没有得到我所有的实际文件夹,但我得到一个不同的子集(其中有些是众所周知的,有些则没有)。

我实现寻呼协议(使用@nextLink参数),所以它不是页面大小的问题。我正在另一个在一个帐户这8个文件夹和文件夹18

所以一定有东西,决定哪些文件夹将被退回。

更新2

我改成这样做,而不是使用测试版的API的文件夹同步。在这种情况下,我也得到了名单,这是其他文件夹的父一位不愿透露姓名的文件夹。它配备了一个ChildFolderCount这是准确的沿。然而,当我做这个文件夹ID的子文件夹的请求,我得到相同的列表。

更新3

下面是当我尝试阅读了回来的一个文件夹的子文件夹我使用的请求URL非零ChildFolderCount。

  GET https://outlook.office.com/api/beta/Me/MailFolders/AAMkADRmMzFmNjZmLWU3MjctNGZiNi1iZTg4LTRmNGQwYTVhMDgxYgAuAAAAAAB8IxaZ5KGbQom4EPywGCSdAQDVy0eYwAzLS63k5pohzykCAAAAAAEJAAA=/childfolders


解决方案

下面就是出现来定义这个API返回了哪些文件夹,什么都没有:


  • 如果我创建office365直接前景网络邮件的文件夹,它显示了在此查询。


  • 如果我创建的Mac邮件的文件夹,它没有。


Mac的邮件访问使用EWS的服务,所以我希望通过它创建的文件夹会像任何其他文件夹。

因此​​,有一些是关于在Mac上的邮件创建的文件夹是$ P $通过这个API返回pvents他们。

在Mac邮件创建的文件夹DO显示在web邮件,反之亦然。

在iPhone上创建

文件夹一样显示出来,所以在我有限的测试,它看起来像Mac的邮件可能是从这个问题的痛苦唯一的应用程序。我的问题是,我的大部分文件夹中的Mac邮件被创造,我有重建他们没有简单的方法。

我想这仅仅是个API中的错误。无论如何,这个回答我原来的问题,应该帮助那里的人尝试使用新的API。

如果我找到一个解决办法,我会张贴在这里。

I'm just getting started with the Outlook REST API. My baseline is the tutorial that uses node-outlook.

First order of business is to retrieve all of the folders in my mail account.

So I issue this REST request:

GET https://outlook.office.com/api/v2.0/Me/MailFolders

Instead of returning all of my folders, it only returns the "well known" folders:

Clutter
Deleted Items
Drafts
Inbox
Junk Email
Outbox
Sent Items
Trash

Am I missing a query parameter or something that says, "no, really, all of them please"?

UPDATE

I tried a different email account, and I also don't get all of my actual folders, but I get a different subset (some of which are well-known, others aren't).

I am implementing the paging protocol (using the @nextLink parameter) so it's not a matter of page sizes. I am getting these 8 folders on one account, and 18 folders on another.

So there must be something that decides what folders will be returned.

UPDATE 2

I changed to doing a folder sync instead using the "beta" API. In this case, I also get an unnamed folder in the list, which is the parent of the other folders. It comes along with a ChildFolderCount which is accurate. However, when I do a child folder request on that folder id I get the same list.

UPDATE 3

Here's the request url I'm using when I attempt to read the child folders of the one folder that comes back with a non-zero ChildFolderCount.

GET https://outlook.office.com/api/beta/Me/MailFolders/AAMkADRmMzFmNjZmLWU3MjctNGZiNi1iZTg4LTRmNGQwYTVhMDgxYgAuAAAAAAB8IxaZ5KGbQom4EPywGCSdAQDVy0eYwAzLS63k5pohzykCAAAAAAEJAAA=/childfolders

解决方案

Here's what appears to define what folders are returned by this API and what are not:

  • If I create a folder in office365 directly on outlook webmail, it shows up in this query.

  • If I create a folder in Mac Mail, it does not.

Mac Mail accesses the service using EWS, so I would expect a folder created by it would be like any other folder.

So there is something about folders created on Mac Mail that prevents them from being returned by this API.

Folders created in Mac Mail DO show up in web mail and vice versa.

Folders created on an iPhone DO show up, so in my limited testing it looks like Mac Mail may be the only app suffering from this problem. The problem I have is most of my folders were created in Mac Mail and I have no easy way of rebuilding them.

I'm thinking this is just a BUG in the API. At any rate, this answers my original question and should help anyone out there trying to use the new API.

If I find a workaround I'll post it here.

这篇关于展望REST API - getFolders不返回所有文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆