ConnectedOrganization の作成
-
[アーティクル]
-
-
名前空間: microsoft.graph
新しい connectedOrganization オブジェクトを作成 します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
EntitlementManagement.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
EntitlementManagement.ReadWrite.All |
HTTP 要求
POST /identityGovernance/entitlementManagement/connectedOrganizations
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-Type |
application/json. Required. |
要求本文
要求本文で 、connectedOrganization オブジェクトの JSON 表記を指定します。
ConnectedOrganization を作成するときに、次の プロパティを指定できます。
| プロパティ |
型 |
説明 |
| displayName |
文字列 |
接続されている組織名。 |
| description |
String |
接続されている組織の説明。 |
| identitySources |
identitySource コレクション |
1 つの要素を持つコレクション、この接続された組織の初期 ID ソース。 |
| state |
connectedOrganizationState |
接続されている組織の状態は、要求者スコープの種類を持つ割り当てポリシーが適用可能 AllConfiguredConnectedOrganizationSubjects かどうかを定義します。 可能な値は、configured、proposed です。 |
応答
成功した場合、このメソッドは応答コードと、応答本文で新しい 201 Created connectedOrganization オブジェクトを返します。
例
要求
POST https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/connectedOrganizations/
Content-Type: application/json
{
"displayName":"Connected organization name",
"description":"Connected organization description",
"identitySources": [
{
"@odata.type": "#microsoft.graph.domainIdentitySource",
"domainName": "example.com",
"displayName": "example.com"
}
],
"state":"proposed"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var connectedOrganization = new ConnectedOrganization
{
DisplayName = "Connected organization name",
Description = "Connected organization description",
IdentitySources = new List<IdentitySource>()
{
new DomainIdentitySource
{
DomainName = "example.com",
DisplayName = "example.com"
}
},
State = ConnectedOrganizationState.Proposed
};
await graphClient.IdentityGovernance.EntitlementManagement.ConnectedOrganizations
.Request()
.AddAsync(connectedOrganization);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const connectedOrganization = {
displayName: 'Connected organization name',
description: 'Connected organization description',
identitySources: [
{
'@odata.type': '#microsoft.graph.domainIdentitySource',
domainName: 'example.com',
displayName: 'example.com'
}
],
state: 'proposed'
};
await client.api('/identityGovernance/entitlementManagement/connectedOrganizations/')
.post(connectedOrganization);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identityGovernance/entitlementManagement/connectedOrganizations/"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphConnectedOrganization *connectedOrganization = [[MSGraphConnectedOrganization alloc] init];
[connectedOrganization setDisplayName:@"Connected organization name"];
[connectedOrganization setDescription:@"Connected organization description"];
NSMutableArray *identitySourcesList = [[NSMutableArray alloc] init];
MSGraphIdentitySource *identitySources = [[MSGraphIdentitySource alloc] init];
[identitySources setDomainName:@"example.com"];
[identitySources setDisplayName:@"example.com"];
[identitySourcesList addObject: identitySources];
[connectedOrganization setIdentitySources:identitySourcesList];
[connectedOrganization setState: [MSGraphConnectedOrganizationState proposed]];
NSError *error;
NSData *connectedOrganizationData = [connectedOrganization getSerializedDataWithError:&error];
[urlRequest setHTTPBody:connectedOrganizationData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ConnectedOrganization connectedOrganization = new ConnectedOrganization();
connectedOrganization.displayName = "Connected organization name";
connectedOrganization.description = "Connected organization description";
LinkedList<IdentitySource> identitySourcesList = new LinkedList<IdentitySource>();
DomainIdentitySource identitySources = new DomainIdentitySource();
identitySources.domainName = "example.com";
identitySources.displayName = "example.com";
identitySourcesList.add(identitySources);
connectedOrganization.identitySources = identitySourcesList;
connectedOrganization.state = ConnectedOrganizationState.PROPOSED;
graphClient.identityGovernance().entitlementManagement().connectedOrganizations()
.buildRequest()
.post(connectedOrganization);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewConnectedOrganization()
displayName := "Connected organization name"
requestBody.SetDisplayName(&displayName)
description := "Connected organization description"
requestBody.SetDescription(&description)
requestBody.SetIdentitySources( []IdentitySource {
msgraphsdk.NewIdentitySource(),
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.domainIdentitySource",
"domainName": "example.com",
"displayName": "example.com",
}
}
state := "proposed"
requestBody.SetState(&state)
result, err := graphClient.IdentityGovernance().EntitlementManagement().ConnectedOrganizations().Post(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
DisplayName = "Connected organization name"
Description = "Connected organization description"
IdentitySources = @(
@{
"@odata.type" = "#microsoft.graph.domainIdentitySource"
DomainName = "example.com"
DisplayName = "example.com"
}
)
State = "proposed"
}
New-MgEntitlementManagementConnectedOrganization -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-type: application/json
{
"id": "35ff48a8-e9d8-4405-8425-0b23694287a4",
"displayName": "Connected organization name",
"description": "Connected organization description",
"createdDateTime": "2021-11-10T01:13:15.541617Z",
"modifiedDateTime": "2021-11-10T01:13:15.541617Z",
"state": "proposed",
"identitySources": []
}