I try to get the list of folders of an Outlook account using the REST API.
Using the MailFolders endpoint, I only get a subset of the folders (for example I'm not getting the Inbox and the Sent Items folders).
If I list all the messages of the account and then for each message try to fetch the ParentFolderId, I get a 404 error for a bunch of them. I'm only able to get the same folders I got from the MailFolders endpoint.
Of course this works for all the other Office 365 accounts I have. And this account doesn't look different from the others.
It's not a matter of folders being renamed because I can see those folders in the Outlook UI.
Of course I correctly paginate the results when both fetching the folders or listing the messages. And again this works fine with all the other Outlook accounts.
I'm using the https://outlook.office.com/api/v2.0/me/MailFolders?%24top=50 endpoint.
Any insights?
Thanks,
Jeremy
Response:
HTTP/1.1 404 Not Found
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Server: Microsoft-IIS/8.5
request-id: e98a3488-3441-474c-8cff-c905f8b9f299
X-CalculatedFETarget: MWHPR1301CU001.internal.outlook.com
X-BackEndHttpStatus: 404
X-FEProxyInfo: MWHPR1301CA0012.NAMPRD13.PROD.OUTLOOK.COM
X-CalculatedBETarget: MWHPR16MB1661.namprd16.prod.outlook.com
X-BackEndHttpStatus: 404
OData-Version: 4.0
X-AspNet-Version: 4.0.30319
X-DiagInfo: MWHPR16MB1661
X-BEServer: MWHPR16MB1661
X-FEServer: MWHPR1301CA0012
X-Powered-By: ASP.NET
X-FEServer: BY2PR02CA0116
X-MSEdge-Ref: Ref A: 0872CED88164470BA7F119058A1F5CBF Ref B: BAYEDGE0318 Ref C: Thu Apr 27 10:58:51 2017 PST
Date: Thu, 27 Apr 2017 17:58:51 GMT
{
"error":{
"code":"ErrorItemNotFound",
"message":"The specified object was not found in the store."
}
}
{"error":{"code":"ErrorItemNotFound","message":"The specified object was not found in the store."}}
– jboga< HTTP/1.1 404 Not Found < Cache-Control: private < Transfer-Encoding: chunked < Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 < Server: Microsoft-IIS/8.5 < Set-Cookie: exchangecookie=c7fc4cb01bfb41c884b7d6f219181e01; expires=Fri, 27-Apr-2018 17:58:51 GMT; path=/; HttpOnly < request-id: e98a3488-3441-474c-8cff-c905f8b9f299
– jboga< X-CalculatedFETarget: MWHPR1301CU001.internal.outlook.com < X-BackEndHttpStatus: 404 < X-FEProxyInfo: MWHPR1301CA0012.NAMPRD13.PROD.OUTLOOK.COM < X-CalculatedBETarget: MWHPR16MB1661.namprd16.prod.outlook.com < X-BackEndHttpStatus: 404 < OData-Version: 4.0 < X-AspNet-Version: 4.0.30319 < X-DiagInfo: MWHPR16MB1661 < X-BEServer: MWHPR16MB1661 < X-FEServer: MWHPR1301CA0012 < X-Powered-By: ASP.NET < X-FEServer: BY2PR02CA0116 < X-MSEdge-Ref: Ref A: 0872CED88164470BA7F119058A1F5CBF Ref B: BAYEDGE0318 Ref C: Thu Apr 27 10:58:51 2017 PST < Date: Thu, 27 Apr 2017 17:58:51 GMT
– jboga