question

JulienSarlat-2493 avatar image
0 Votes"
JulienSarlat-2493 asked ShivamDhiman-1582 rolled back

List all messages expect the archived ones

Hello,

I need to get the list of my emails and exclude all the archived ones.

I guess this is the right endpoint https://graph.microsoft.com/v1.0/me/messages

What should I add to the call?

Thanks

microsoft-graph-mail
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Deva-MSFT avatar image
0 Votes"
Deva-MSFT answered

You can't access the in-place archive mailbox and it's not supported in Microsoft Graph API.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShivamDhiman-1582 avatar image
0 Votes"
ShivamDhiman-1582 answered ShivamDhiman-1582 rolled back

Hi @JulienSarlat-2493

To get the desired results, you need Archive folder id use this below endpoint for the same

 https://graph.microsoft.com/v1.0/me/mailFolders

179825-archiveid.png


To get the results, you can use the below endpoint using Filter.

 https://graph.microsoft.com/v1.0/me/messages?$filter=parentFolderId ne '{ArchievefolderID}'

Result
179827-exclude2.png

Using the above endpoint, you will get all mails except Archive Mail.

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


archiveid.png (59.8 KiB)
exclude2.png (104.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.