Graph REST API [邮件]如何下载带有附件的电子邮件.eml

时间:2020-09-04 10:32:20

标签: java email microsoft-graph-api outlook-restapi microsoft-graph-mail

以下代码是我检索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();

1 个答案:

答案 0 :(得分:0)

这里是documentation

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

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