我想在创建组时将成员添加到组中。我怎样才能做到这一点?
请求:
POST https://graph.microsoft.com/v1.0/groups
Content-Type: application/json
{
"displayName": "displayName",
"mailEnabled": true,
"mailNickname": "mailNickname",
"securityEnabled": false,
"groupTypes": [
"Unified"
],
"members@odata.bind": [
"https://graph.microsoft.com/v1.0/users/{userId}"
]
}
和代码:
Group group = new Group();
group.displayName = "displayName";
group.mailEnabled = true;
group.mailNickname = "mailNickname";
group.securityEnabled = false;
List<String> groupTypes = new ArrayList<>();
groupTypes.add("Unified");
group.groupTypes=groupTypes;
String userId = "userId";
//HERE add members to group
//group.members=???
serviceClient.groups().buildRequest().post(group);
我应该如何以及在哪里编写“members@odata.bind”部分?