目前,我从图形 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/