POST /external/connections/{connectionsId}/groups/{externalGroupId}/members
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, supply a JSON representation of the identity object.
You can specify the following properties when creating an identity resource for a member in an externalGroup.
Property
Type
Description
id
String
The unique id of the member. It would be the objectId in case of Azure Active Directory users or groups and the externalGroupId in case of external groups. Required.
type
microsoft.graph.externalConnectors.identityType
The type of member added to the external group. Possible values are: user,group, externalGroup. Required.
Response
If successful, this method returns a 201 Created response code and an identity object in the response body.
Examples
Example 1: Add an Azure Active Directory user as a member
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "e811976d-83df-4cbd-8b9b-5215b18aa874",
"type": "user"
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Models.ExternalConnectors.Identity
{
Id = "e811976d-83df-4cbd-8b9b-5215b18aa874",
Type = Microsoft.Graph.Models.ExternalConnectors.IdentityType.User,
};
var result = await graphClient.External.Connections["{externalConnection-id}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewIdentity()
id := "e811976d-83df-4cbd-8b9b-5215b18aa874"
requestBody.SetId(&id)
type := graphmodels.USER_IDENTITYTYPE
requestBody.SetType(&type)
result, err := graphClient.External().ConnectionsById("externalConnection-id").GroupsById("externalGroup-id").Members().Post(context.Background(), requestBody, nil)
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Identity();
$requestBody->setId('e811976d-83df-4cbd-8b9b-5215b18aa874');
$requestBody->setType(new IdentityType('user'));
$requestResult = $graphServiceClient->external()->connectionsById('externalConnection-id')->groupsById('externalGroup-id')->members()->post($requestBody);
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "e5477431-1038-484e-bf69-1dfedb97a110",
"type": "group"
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Models.ExternalConnectors.Identity
{
Id = "e5477431-1038-484e-bf69-1dfedb97a110",
Type = Microsoft.Graph.Models.ExternalConnectors.IdentityType.Group,
};
var result = await graphClient.External.Connections["{externalConnection-id}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewIdentity()
id := "e5477431-1038-484e-bf69-1dfedb97a110"
requestBody.SetId(&id)
type := graphmodels.GROUP_IDENTITYTYPE
requestBody.SetType(&type)
result, err := graphClient.External().ConnectionsById("externalConnection-id").GroupsById("externalGroup-id").Members().Post(context.Background(), requestBody, nil)
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Identity();
$requestBody->setId('e5477431-1038-484e-bf69-1dfedb97a110');
$requestBody->setType(new IdentityType('group'));
$requestResult = $graphServiceClient->external()->connectionsById('externalConnection-id')->groupsById('externalGroup-id')->members()->post($requestBody);
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "1431b9c38ee647f6a",
"type": "externalGroup",
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Models.ExternalConnectors.Identity
{
Id = "1431b9c38ee647f6a",
Type = Microsoft.Graph.Models.ExternalConnectors.IdentityType.ExternalGroup,
};
var result = await graphClient.External.Connections["{externalConnection-id}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewIdentity()
id := "1431b9c38ee647f6a"
requestBody.SetId(&id)
type := graphmodels.EXTERNALGROUP_IDENTITYTYPE
requestBody.SetType(&type)
result, err := graphClient.External().ConnectionsById("externalConnection-id").GroupsById("externalGroup-id").Members().Post(context.Background(), requestBody, nil)
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Identity();
$requestBody->setId('1431b9c38ee647f6a');
$requestBody->setType(new IdentityType('externalgroup'));
$requestResult = $graphServiceClient->external()->connectionsById('externalConnection-id')->groupsById('externalGroup-id')->members()->post($requestBody);