gpt4 book ai didi

office365 - 如何使用 Office 365 API 在 Exchange Online 中获取就地存档邮箱

转载 作者:行者123 更新时间:2023-12-02 21:04:08 25 4
gpt4 key购买 nike

我想获取就地邮箱内的文件夹/电子邮件列表。但邮箱列表和文件夹列表都不会返回就地邮箱。

这是我迄今为止尝试过的:

  1. 使用以下请求获取邮箱

请求:

https://outlook.office365.com/api/v1.0/users('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddaeb2b0b8a8aeb8af9daeb2b0b8b9b2b0bcb4b3f3b2b3b0b4beafb2aeb2bba9f3beb2b0" rel="noreferrer noopener nofollow">[email protected]</a>')

回应:

{
"@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": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c4f535159494f594e7c4f5351595853515d555212535251555f4e534f535a48125f5351" rel="noreferrer noopener nofollow">[email protected]</a>",
"DisplayName": "User Name",
"Alias": "user1",
"MailboxGuid": "12312312-a498-46d1-93a8-870cd3faffec"
}
  • 获取文件夹列表
  • 请求:

    https://outlook.office365.com/api/v1.0/users('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="64170b09011117011624170b0901000b09050d0a4a0b0a090d07160b170b02104a070b09" rel="noreferrer noopener nofollow">[email protected]</a>')/folders?$top=100

    回应:

    {
    "@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('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d7a4b8bab2a2a4b2a597a4b8bab2b3b8bab6beb9f9b8b9babeb4a5b8a4b8b1a3f9b4b8ba" rel="noreferrer noopener nofollow">[email protected]</a>')/Folders('ABCDA3AYxNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAABgaA9RAAA=')",
    "Id": 'ABCDA3AYxNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAABgaA9RAAA=',
    "DisplayName": "Clutter",
    "ParentFolderId": "ABCDAAVCNjE2NjQyLWE0OTgtNDZkMy05M2E4LTg3MGNkM2ZhZmZlYwAuAAAAAACbFtMO1RLxQoChh4quwNSoAQChU257vJJfSLjbblRIqUFSAAAAAAEIAAA=",
    "ChildFolderCount": 0,
    "UnreadItemCount": 0,
    "TotalItemCount": 1
    },
    {
    .... other folders like Inbox, Conversations, Conversations history etc.
    }]
    }

    是否可以使用 Office 365 统一 API 来获取它?如果没有,还有其他选择吗?如果是,Exchange Online 如何处理 In-Place 邮箱;文件夹级别(看起来不像)还是用户级别邮箱?​​

    注意:我更改了请求和响应中的敏感信息

    最佳答案

    获取https://graph.microsoft.com/v1.0/me/mailFolders/ {id}/childFolders这里的 id 可以使用众所周知的文件夹名称。它是存档邮箱的 archivemsgfolderroot。

    关于office365 - 如何使用 Office 365 API 在 Exchange Online 中获取就地存档邮箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36939501/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com