azure - 从 Azure Graph API 检索 itemAttachment

标签 azure microsoft-graph-api

目前,我从图形 API 收到电子邮件(和附件)。一些收到的电子邮件附加了其他消息 (.msg),并且这些消息中包含附件。谁能告诉我如何检索附件中的附件。

我已经尝试过:

https://graph.microsoft.com/api/v1.0/me/messages/{messageid}/attachments/{attachmentmessageid}?$expand=microsoft.graph.itemAttachment/Item

但出现错误:

{
  "error": {
    "code": "BadRequest",
    "message": "Invalid version",
    "innerError": {
      "request-id": "xxxxxxxxxxxxx",
      "date": "2016-08-30T19:46:36"
    }
  }
}

最佳答案

这对我有用:

https://graph.microsoft.com/v1.0/users/myAccount/messages/{messageId}/attac
hments/{attachmentId}?$expand=microsoft.graph.itemattachment/item

返回的 json 有一个具有以下值的 item 节点:

{"@odata.type":"#microsoft.graph.message","id":"","createdDateTime":"2018-01-18T01:51:02Z","lastModifiedDateTime":"2018-01-18T01:50:36Z",...

但是,我想补充一点,该 ItemAttachment 中的嵌套电子邮件(或嵌套电子邮件中的任何附件)不可提取。我想要一种将 ItemAttachment 视为 FileAttachment 的方法,以便仅下载字节。我将就此另开一个 SO 问题。

关于azure - 从 Azure Graph API 检索 itemAttachment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39235946/

相关文章:

c# - 使用图形 API 查询 Azure AD

azure - 如何在azure门户中创建对所有订阅中的所有资源具有只读访问权限的用户?

c#-4.0 - 如何使用 C# 创建新的 Azure CDN?

azure - 具有 azure 函数和 webpack 的无服务器

ios - 使用 SFAuthenticationSession 将用户登录到 Microsoft Graph

azure - 如何使用 Microsoft OAuth 获取另一个资源的访问 token

excel - 通过 Microsoft Graph API 创建 excel 文件

java - 无法嵌入 Power BI 报告

powershell - 如何使用 powershell 将文件从一个 Blob 存储容器移动到另一个 Blob 存储容器

microsoft-graph-api - 在 C# 中使用 REST 示例的图形 API SendMail 和附件