Microsoft Graph API Java - 使用 displayName 获取组 [英] Microsoft Graph API Java - get group using displayName
本文介绍了Microsoft Graph API Java - 使用 displayName 获取组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Microsoft Graph API(java SDK)向组添加成员.但是我看到我只能使用 "id" 拉出一个组.但是应该有一种简单的方法来使用 name 或 displayName 拉出组信息?我正在尝试获取组 ID,以便我可以使用它来添加成员
I am using Microsoft Graph API( java SDK) to add members to the group. But I see that I could only pull a group using the "id" .But there should be an easy way to pull the group information using name or displayName? I am trying to get the group id, so that I could use it to add members
Group group = graphClient.groups("id").buildRequest().get();
推荐答案
您是否尝试过这样的事情?
Have you tried something like this?
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new QueryOption("$filter", "startswith(displayName, 'Hello')"));
IGroupCollectionPage groups = graphClient.groups()
.buildRequest(requestOptions)
.get();
这应该过滤所有以Hello"开头的displayName"组.
This should filter all groups with "displayName" starting with "Hello".
这篇关于Microsoft Graph API Java - 使用 displayName 获取组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文