Microsoft Graph API Java - get group using displayName

大兔子大兔子 提交于 2021-02-11 16:53:14

问题


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();


回答1:


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();

This should filter all groups with "displayName" starting with "Hello".



来源:https://stackoverflow.com/questions/60417041/microsoft-graph-api-java-get-group-using-displayname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!