Exchange Server has a really nice feature called In-Place Archiving it helps you regain control of your organization's messaging data by eliminating the need for personal store (.pst) files and allowing users to store messages in an archive mailbox. (c) MS
As well, Microsoft provides you with the ability to query data from Office 365 by using Graph API
How can you get messages from the archived mailbox using Graph API?
Microsft has a list (or to be more correct enumeration) of a so-called "Well Known Folder Name". You can use items from this list in the Graph API queries instead of folder id. To access the root of the archived mailbox (aka In-Place Archive) you should use
You can use it to get information about your archived mailbox:
<id> with the id of a user (use can get it via
To get the list of folders inside the In-Place Archive mailbox, use the following command:
And to get messages from the
Inbox folder in the
In-Place Archive mailbox you can use the following query:
Note: You can also use Inbox from the WellKnownFolderName enum instead of an id.
Graph API is a powerful REST API with a lot of features to query data from Office 365, Windows 10, and Enterprise Mobility and Security.