How to retrieve uncategorized emails using Microsoft Graph API

Ravindra Shukla 116 Reputation points
2021-05-12T11:35:37.323+00:00

Hi,

I am using Microsoft Graph to retrieve the emails from the mailboxes, I know how to get the emails based on categories using below query.

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=categories/any(c:c eq 'Yellow category')

However I want to retrieve all the emails or count of all the emails which don't have any categories assigned. I tried using the above query in other way as

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=categories/any(c:c ne 'Yellow category')

and also like as below, but its not working.

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=categories/any()

How can I achieve this?

Any help or pointers are appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,939 questions
{count} votes

10 answers

Sort by: Most helpful
  1. Danstan Onyango 3,651 Reputation points Microsoft Employee
    2021-05-13T13:33:07.92+00:00

    As far as I know, this capability is currently not supported via MS Graph API. I have created this GitHub Issue that may help provide details of whether this is possible and how to achieve it.


  2. Ravindra Shukla 116 Reputation points
    2021-05-14T07:10:11.46+00:00

    @Danstan Thank you for your reply on this issue. I hope we'll have some update on the github issue.

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  5. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more