如何使用 Microsoft Graph Api 获取 Office 365 的邮件大小?

How to get the message size of Office 365 using Microsoft Graph Api?

2016 年有 次询问了相同的主题。答案是 运行 查询:

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$expand=singleValueExtendedProperties($filter=Id eq 'LONG 0x0E08')

如果我运行 MS Graph 查询消息大小不返回。 $expand 被忽略。我得到了相同的回复,因为它没有被指定。
如何获取邮件大小?

Documentation 解释了我没有得到尺码的原因 “确保对过滤器字符串中的 space 个字符应用 URL 编码。” 我把URL改成了

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$expand=singleValueExtendedProperties($filter=Id%20eq%20'LONG%200x0E08')

我得到了以字节为单位的消息大小

"singleValueExtendedProperties@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('XXXX')/mailFolders('Inbox')/messages('AAAAA')/singleValueExtendedProperties",
"singleValueExtendedProperties": [
    {
        "id": "Long 0xe08",
        "value": "100265"
    }
]