首页 > 解决方案 > Graph REST API [Mail] 如何下载带有附件的电子邮件 .eml

问题描述

以下代码是我检索 EML 文件的调用,但我还需要检索其中的附件。我该怎么做 ?

jsonAttach = (StringResponse) Unirest.get(
                        String.format("https://graph.microsoft.com/v1.0/users/%s/messages/%s/$value", 
                                user_email,tempMailId))
                        .header("Accept", "application/json")
                        .header("Authorization", tokenType + " " + accessToken)
                        .asString();

标签: javaemailmicrosoft-graph-apioutlook-restapimicrosoft-graph-mail

解决方案


这是文档

我尝试了以下 API 调用,它对我有用。

GET graph.microsoft.com/v1.0/me/messages{id}/attachments/{id}/$value)

推荐阅读