问题
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:
- 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"
}
- 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
回答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.
回答2:
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.
来源:https://stackoverflow.com/questions/36939501/how-to-get-in-place-archive-mailbox-in-exchange-online-using-office-365-apis