问题
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