2

I want to get list of folders/emails inside In-Place mailboxes. But both mailbox list and folder list doesn't returns In-Place mailboxes.

This is what I have tried till now:

  1. Get mailboxes using following request

Request:

https://outlook.office365.com/api/v1.0/users('someuser@somedomain.onmicrosoft.com')

Response:

{
    "@odata.context": "https://outlook.office365.com/api/v2.0/$metadata#Users/$entity",
    "@odata.id": "https://outlook.office365.com/api/v2.0/Users('12637010-f344-4827-9e3b-21218392985d@649b37da-e479-45dc-a099-fda797d7fcee')",
    "Id": "12637010-f344-4827-9e3b-21218392985d@649b37da-e479-45dc-a099-fda797d7fcee",
    "EmailAddress": "someuser@somedomain.onmicrosoft.com",
    "DisplayName": "User Name",
    "Alias": "user1",
    "MailboxGuid": "12312312-a498-46d1-93a8-870cd3faffec"
}
  1. Get folders listing

Request:

https://outlook.office365.com/api/v1.0/users('someuser@somedomain.onmicrosoft.com')/folders?$top=100

Response:

{
    "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Users('someuser%40somedomain.onmicrosoft.com')/Folders",
    "value": [{
        "@odata.id": "https://outlook.office365.com/api/v1.0/Users('someuser@somedomain.onmicrosoft.com')/Folders('ABCDA3AYxNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAABgaA9RAAA=')",
        "Id": 'ABCDA3AYxNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAABgaA9RAAA=',
        "DisplayName": "Clutter",
        "ParentFolderId": "ABCDAAVCNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAAAAAAEIAAA=",
        "ChildFolderCount": 0,
        "UnreadItemCount": 0,
        "TotalItemCount": 1
    },
    {
.... other folders like Inbox, Conversations, Conversations history etc.
    }]
}

Is it possible to get it use Office 365 unified APIs? If not, is there any alternative? If yes, how does In-Place mailboxes are treated by Exchange online; folder-level(doesn't looks like) or at user level mailboxes?

Note: I have changed sensitive information in requests and responses

Naveen
  • 77
  • 1
  • 10

3 Answers3

3

GET https://graph.microsoft.com/v1.0/me/mailFolders/{id}/childFolders Here as id You can use well known folder names. It's archivemsgfolderroot for archive mailbox.

Denis
  • 31
  • 2
  • This is the correct answer. Just call https://graph.microsoft.com/v1.0/me/mailFolders/archivemsgfolderroot/childFolders – Morten Jun 21 '19 at 07:05
1

Is it possible to get it use Office 365 unified APIs? If not, is there any alternative?

Archive mailboxes (called an In-Place Archive in Exchange Online) are secondary mailboxes that are associated with a user. The Office 365 API does not support accessing to archive mailboxes.

BTW, achieving is a feature of Exchange, the EWS API supports archiving an item, but it does not support listing mails in achieve mailbox either (Archiving in EWS in Exchange).

For new feature request of Office 365 API, you can consider submitting it on Office Developer Platform UserVoice.

Jeffrey Chen
  • 4,650
  • 1
  • 18
  • 22
1

You can use a "well-known" folder name

ArchiveMsgFolderRoot

to access the in-place archive mailbox. For example, to get all messages from the Inbox folder inside the in-place archive mailbox use the following query:

GET https://graph.microsoft.com/v1.0/me/mailFolders/ArchiveMsgFolderRoot/childFolders/Inbox/messages

Note: it also uses another predefined folder id (Inbox)

A bit more details on how to work with In-Place Archive Mailbox via Graph API

and a full list of well-known folder names

druss
  • 1,820
  • 19
  • 18