最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

email - MSgraph Java SDK, retrieve well-know folder - Stack Overflow

programmeradmin0浏览0评论

Previously with the V5 of the Microsoft Java SDK for MSGraph, to retrieve the inbox folder by it's "well known name", I was doing the following:

return graphClient.users("[email protected]")
                .mailFolders("inbox") // hardcoded well know name in place of id
                .messages()
                .get();

But since the V6 update, I can't find anything in the help pages nor the SDK on how to achieve the same. It looks like there is a class WellKnownFolderName in the SDK but I can't figure out how to use it.

I tried some things like

var folderId = new FolderId(WellKnownFolderName.Inbox).getUniqueId();
var inboxFolder = graphClient.me().mailFolders().byMailFolderId(folderId).get();

But folderId id is null

Previously with the V5 of the Microsoft Java SDK for MSGraph, to retrieve the inbox folder by it's "well known name", I was doing the following:

return graphClient.users("[email protected]")
                .mailFolders("inbox") // hardcoded well know name in place of id
                .messages()
                .get();

But since the V6 update, I can't find anything in the help pages nor the SDK on how to achieve the same. It looks like there is a class WellKnownFolderName in the SDK but I can't figure out how to use it.

I tried some things like

var folderId = new FolderId(WellKnownFolderName.Inbox).getUniqueId();
var inboxFolder = graphClient.me().mailFolders().byMailFolderId(folderId).get();

But folderId id is null

Share Improve this question asked Jan 18 at 10:20 DamianDamian 932 silver badges4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can specify the well-know name in byMailFolderId()

MailFolder result = graphClient.me().mailFolders().byMailFolderId("inbox").get();
发布评论

评论列表(0)

  1. 暂无评论