了解 Graph API 中的“hasAttachments”属性:内联附件的异常

问题描述 投票:0回答:1

我正在使用 Microsoft Graph API 从 Outlook 检索消息详细信息,我发现属性“hasAttachments”有些奇怪。

通常,“有附件”

设置为 true :

  • 当邮件包含一个或多个未嵌入电子邮件正文中的附件时

    示例:Graph API response for a message with non-inline attachment

在以下两种情况下设置为 false:

  • 当消息没有附件时

    示例:Graph API response for a message with no attachments

  • 当一封邮件包含一个或多个附件并且其所有附件都嵌入到电子邮件正文中(称为内联附件)时。

    示例:Graph API response for a message with only inline attachment

有一个名为“isInline”的属性,如果附件是内联的,则该属性设置为 true。

案例场景:

但是,我从 Graph API 得到的响应似乎并不符合预期。

我遇到了这样一种情况:消息中包含的附件不是内联附件,但在 Graph API 响应中,属性“hasAttachment”和“isInline”均为 false。

通常,如果消息有非内联附件,“hasattachment”属性将为 true,但在我的某些情况下,它被设置为 false。我已在下面的链接中附上了我的回复副本

Graph API response for a message that has non-Inline attachment but with

我在图形浏览器中使用的查询:

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$select=hasAttachments&$expand=attachments

如果我有任何关于我可能遗漏的内容或我做错的事情的指导,我将不胜感激。预先感谢您的帮助!

email outlook microsoft-graph-api email-attachments inline-attachments
1个回答
0
投票

该附件被列为

application/x-microsoft-rpmsg-message
(如果您有原始 MIME 格式的“原始”电子邮件,而不是 MS Graph 的 JSON 表示形式)将是此 MIME 电子邮件正文的“替代视图” mail - 这就是为什么 MS Graph 不将其视为“附件”。

© www.soinside.com 2019 - 2024. All rights reserved.