0
votes

I have been using the Unified API lately, specifically the https://graph.microsoft.com/beta/me/Messages?$filter=IsRead eq false call.

What I want to achieve is to give the current user a count of how many unread mails they have in their inbox. The call above returns the unread messages and I can count them, BUT it also returns unread messages in the "Deleted Items" folder.

Using https://outlook.office365.com/api/v1.0/me/folders/Inbox/messages I can filter by different folders, but using the Unified API it seems that all messages are mapped to the same parent folder? Atleast for me a message from "Inbox" has the same ParentFolderId as a message in "Deleted Items".

Any ideas on how I can achieve my goal of providing the user with unread messages from the "Inbox" folder using the unified API?

1

1 Answers

0
votes

Even,

You are right, /messages collection returns all the messages across the entire mailbox.

Today, there is no way to do what you want using the unified API. We are working on enabling Mail Folders support in the Unified API and it is coming really soon. I cannot give you a definite timeline just yet.

I also verified that the parentfolderid does return the "deleteditems" folder id for messages in that folder. Please let us know if you are seeing it otherwise.

Now, even if you could identify the 'Inbox' Folder ID, the parentfolderId field is not filterable, so you will not be able to make a query like '/me/messages?$filter=parentfolderid eq '27A.....'