リクエストを作成する
[アーティクル]
03/09/2023
2 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
新しい delegatedAdminRelationshipRequest オブジェクトを 作成します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DelegatedAdminRelationship.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
サポートされていません。
HTTP 要求
POST /tenantRelationships/delegatedAdminRelationships/{delegatedAdminRelationshipId}/requests
名前
説明
Authorization
ベアラー {token}。 必須です。
Content-Type
application/json. 必須です。
要求本文
要求本文で、 delegatedAdminRelationshipRequest オブジェクトの JSON 表現を指定します。
delegatedAdminRelationshipRequest を作成するときに、次のプロパティを指定できます。
プロパティ
型
説明
action
delegatedAdminRelationshipRequestAction
委任された管理者関係に対して実行されるアクション。 必須です。 使用可能な値は、 lockForApproval
、 terminate
です。
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文で delegatedAdminRelationshipRequest オブジェクトを返します。 応答には、作成された委任された管理者関係要求の URL を含む Location ヘッダーが含まれています。
例
要求
POST https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships/5d027261-d21f-4aa9-b7db-7fa1f56fb163-8777b240-c6f0-4469-9e98-a3205431b836/requests
Content-Type: application/json
{
"action": "lockForApproval"
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new DelegatedAdminRelationshipRequest
{
Action = DelegatedAdminRelationshipRequestAction.LockForApproval,
};
var result = await graphClient.TenantRelationships.DelegatedAdminRelationships["{delegatedAdminRelationship-id}"].Requests.PostAsync(requestBody);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const delegatedAdminRelationshipRequest = {
action: 'lockForApproval'
};
await client.api('/tenantRelationships/delegatedAdminRelationships/5d027261-d21f-4aa9-b7db-7fa1f56fb163-8777b240-c6f0-4469-9e98-a3205431b836/requests')
.post(delegatedAdminRelationshipRequest);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
DelegatedAdminRelationshipRequest delegatedAdminRelationshipRequest = new DelegatedAdminRelationshipRequest();
delegatedAdminRelationshipRequest.action = DelegatedAdminRelationshipRequestAction.LOCK_FOR_APPROVAL;
graphClient.tenantRelationships().delegatedAdminRelationships("5d027261-d21f-4aa9-b7db-7fa1f56fb163-8777b240-c6f0-4469-9e98-a3205431b836").requests()
.buildRequest()
.post(delegatedAdminRelationshipRequest);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewDelegatedAdminRelationshipRequest()
action := graphmodels.LOCKFORAPPROVAL_DELEGATEDADMINRELATIONSHIPREQUESTACTION
requestBody.SetAction(&action)
result, err := graphClient.TenantRelationships().DelegatedAdminRelationshipsById("delegatedAdminRelationship-id").Requests().Post(context.Background(), requestBody, nil)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new DelegatedAdminRelationshipRequest();
$requestBody->setAction(new DelegatedAdminRelationshipRequestAction('lockforapproval'));
$requestResult = $graphServiceClient->tenantRelationships()->delegatedAdminRelationshipsById('delegatedAdminRelationship-id')->requests()->post($requestBody);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
Location: https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships/c45e5ffb-3de2-4938-a214-b7eed802db66-4be56058-bb48-4a8e-8282-6cf0e98e6c9d/requests/5a6666c9-7282-0a41-67aa-25a5a3fbf339
{
"@odata.type": "#microsoft.graph.delegatedAdminRelationshipRequest",
"@odata.context": "https://graph.microsoft.com/v1.0/tenantRelationships/$metadata#requests",
"id": "5a6666c9-7282-0a41-67aa-25a5a3fbf339",
"action": "lockForApproval",
"status": "created",
"createdDateTime": "2022-02-10T10:55:47.1180588Z",
"lastModifiedDateTime": "2022-02-10T10:55:47.1180588Z"
}