You can't access the in-place archive mailbox and it's not supported in Microsoft Graph API.
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
2 answers
Sort by: Most helpful
-
Deva-MSFT 2,266 Reputation points Microsoft Employee
2021-07-30T16:22:58.117+00:00 -
Shivam Dhiman 6,056 Reputation points
2022-03-03T17:52:49.737+00:00 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
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
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".