Get unread emails one by one only from Inbox folder in MIME

Sunil 1 Reputation point
2022-07-26T16:41:08.71+00:00

Hi Experts,

How to get unread emails one by one only from Inbox folder in MIME ?

I used below microsoft graph endpoint -
https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead+ne+true

It give by default 10 results. I can add an additional filter top=1. Is this right ?
https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead+ne+true&top=1

Responses so far received are in JSON. How to get responses in MIME ? $value seems not supported for collections(messages)
Appreciate your assistance!

Many Thanks,
Sunil

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,446 Reputation points
    2022-07-26T23:58:10.69+00:00

    It give by default 10 results. I can add an additional filter top=1. Is this right ?

    https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead+ne+true&top=1

    using Top will limit the results return no filter them if you want to make sure you always get the last message in the inbox you should also use orderby

    Responses so far received are in JSON. How to get responses in MIME ? $value seems not supported for collections(messages)

    Appreciate your assistance!

    You can't return mime using the messages collection it must be done per message using the id of the message and the $value endpoint if you want to request multiple messages in one request then you can batch them https://learn.microsoft.com/en-us/graph/json-batching (you can do 4 concurrent request of 20 dependson)

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.