如何正确阅读Microsoft Graph发送的电子邮件文件夹?

时间:2017-07-26 23:58:31

标签: json outlook office365 microsoft-graph office365api

我正在尝试阅读我的电子邮件已发送文件夹。

GET https://graph.microsoft.com/v1.0/me/mailfolders('outbox')/messages
Graph Explorer中的

,我总是得到一个空数组:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('16f5a7b6-5a15-4568-aa5a-31bb117e9967')/mailFolders('outbox')/messages",
    "value": []
}

当我跑步时

GET https://graph.microsoft.com/v1.0/me/mailfolders

仅发送文件夹(发件箱)显示0封电子邮件,但实际上文件夹中有电子邮件。

如何正确阅读已发送文件夹?感谢

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('576552d5-3bc0-42a6-a53d-bfceb405db23')/mailFolders",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/mailfolders?$skip=10",
    "value": [
        {
            "id": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAHurthAAA=",
            "displayName": "Archive",
            "parentFolderId": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAEIAAA=",
            "childFolderCount": 0,
            "unreadItemCount": 0,
            "totalItemCount": 3510
        },
        {
            "id": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAEMAAA=",
            "displayName": "Inbox",
            "parentFolderId": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAEIAAA=",
            "childFolderCount": 5,
            "unreadItemCount": 1,
            "totalItemCount": 44
        },
        {
            "id": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAELAAA=",
            "displayName": "Outbox",
            "parentFolderId": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAEIAAA=",
            "childFolderCount": 0,
            "unreadItemCount": 0,
            "totalItemCount": 0
        }
    ]
}

1 个答案:

答案 0 :(得分:2)

发件箱不是已发送邮件。我希望Outbox几乎总能拥有0条消息,因为Outbox只保留发送消息,因此消息只驻留在那里很短的时间。

要获取已发送的项目,请使用https://graph.microsoft.com/v1.0/me/mailFolders/SentItems