【发布时间】:2017-07-01 19:33:21
【问题描述】:
当我在 office365 网络浏览器页面中打开电子邮件时,有一个选项可以下载此电子邮件 itemAttachment 的附件内容(使用 Microsoft Outlook 附加到当前邮件的另一封邮件)- * .eml 文件,(内容类型:RFC-822)。
但是,当我尝试通过 Graph API(相同的操作)获取此 itemAttachment 的内容时, contentBytes 响应属性不存在。
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('bbbbb')/messages('fffff')/attachments",
"value": [{
"@odata.type": "#microsoft.graph.itemAttachment",
"id": "gggg",
"lastModifiedDateTime": "2017-02-13T16:29:45Z",
"name": "The Daily Build - Compiling your C code to .NET",
"contentType": "message/rfc822",
"size": 99129,
"isInline": false
}
]
}
任何想法如何通过 Graph API ( contentType=itemAttachment ) 获取附加的 Outlook 消息的内容? fileAttachment contentType 工作正常,我可以从 Graph API 响应的 contentBytes 属性中获取内容。考虑以下 API 端点:
https://graph.microsoft.com/beta/me/messages/{id}/附件
https://graph.microsoft.com/beta/me/messages/{id}/attachments/{attachmentId}
https://graph.microsoft.com/beta/me/messages/{id}/attachments/{attachmentId}?$expand=#microsoft.graph.itemAttachment/item
以上都不返回附加项目的内容。
【问题讨论】:
-
暂不支持下载itemAttachment内容。我们现在正在评估它,当我有具体结果时我会发布更新。
-
@SriramDhanasekaran-MSFT 有什么更新吗?现在可以检索 itemAttachment 的内容吗?
-
你试过我的答案了吗?
-
是的,你是对的@RiccardoGDev,该功能仍在开发中,它在测试版(或预览版)中可用,但我不能对实时应用程序使用测试版或预览版。等待稳定版本。
标签: outlook office365 microsoft-graph-api