none
Retrieve Flagged Messages RRS feed

  • Question

  • Using the Microsoft Graph API, I am successfully able to get messages, like so - https://graph.microsoft.com/v1.0/me/messages? - I can also filter by read - https://graph.microsoft.com/v1.0/me/messages?$filter=isRead eq false - How can I filter flagged emails? I can't see it documented anywhere?
    Friday, March 17, 2017 5:49 AM

Answers

  • Well, if anyone else has been looking for this, this feature has now been added, therefore you can now retrieve flagged messages using the Microsoft Graph API:

    GET https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false or flag/flagStatus eq 'flagged'

    • Marked as answer by Tim Maiden Saturday, April 14, 2018 5:31 PM
    Saturday, April 14, 2018 5:31 PM

All replies

  • Hi,

    This is not possible using the Microsoft Graph API. You can use the Outlook REST API for this. Use the following call:

    GET https://outlook.office.com/api/beta/me/mailfolders/inbox/messages?$filter=Flag/FlagStatus <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="722b9429-6728-4dea-9e90-635567a29cfd" id="45c2c5b5-dba4-4f7b-b858-448a5c09f53c">eq</gs> 'Flagged'

    Refer to the following article: http://keepstalking.info/questions/42057361/retrieving-flagged-emails-messages-via-o365-rest-api


    Regards, Sjoukje

    Please remember to click 'Mark as Answer' on the post that helps you.


    Monday, March 20, 2017 5:34 PM
    Moderator
  • Well, if anyone else has been looking for this, this feature has now been added, therefore you can now retrieve flagged messages using the Microsoft Graph API:

    GET https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false or flag/flagStatus eq 'flagged'

    • Marked as answer by Tim Maiden Saturday, April 14, 2018 5:31 PM
    Saturday, April 14, 2018 5:31 PM
  • Hi Tim,

    I dont suppose you know how to perform the same filter, but for emails that are not flagged?

    I have been able to filter on flagged, and remove the filter to pull everything, but the process i am currently automated ends by flagging the emails, so im trying trying to apply a filter that will only return emails with no flag.

    I have attempted to replace "flag/flagstatus eq 'flagged'" with "flag/flagstatus eq 'notflagged'" (using different combinations of captial and lower case 'n' and 'f' but i cant get it to work and I'm not having much luck searching the net...

    Any knowledge you can share would be greatly appreciated.

    Wednesday, September 11, 2019 12:25 PM