accessPackageAssignmentRequest のCreate

名前空間: microsoft.graph

重要

Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。

Microsoft Entraエンタイトルメント管理で、新しい accessPackageAssignmentRequest オブジェクトを作成します。 この操作は、ユーザーをアクセス パッケージに割り当てたり、割り当てを更新したり、アクセス パッケージの割り当てを削除したりするために使用されます。

この API は、次の国内クラウド展開で使用できます。

グローバル サービス 米国政府機関 L4 米国政府機関 L5 (DOD) 21Vianet が運営する中国

アクセス許可

この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください

アクセス許可の種類 最小特権アクセス許可 特権の高いアクセス許可
委任 (職場または学校のアカウント) EntitlementManagement.ReadWrite.All 注意事項なし。
委任 (個人用 Microsoft アカウント) サポートされていません。 サポートされていません。
アプリケーション EntitlementManagement.ReadWrite.All 注意事項なし。

HTTP 要求

POST /identityGovernance/entitlementManagement/assignmentRequests

要求ヘッダー

名前 説明
Authorization ベアラー {token}。 必須です。
Content-Type application/json. 必須です。

要求本文

要求本文で、 accessPackageAssignmentRequest オブジェクトの JSON 表現を指定します。

管理者がユーザーの割り当てを作成するように要求するには、requestType プロパティの値が ですadminAdd割り当てプロパティには、割り当てられているユーザーの が含まれます。また、割り当て済みのユーザーの が含まれていますtargetId。assignmentPolicyId プロパティは accessPackageAssignmentPolicy を識別し、accessPackage を識別する accessPackageId プロパティです。

管理者が割り当ての更新を要求する場合 (たとえば、割り当てを拡張したり、質問に対する回答を更新したりするには)、requestType プロパティの値は adminUpdateです。割り当てプロパティには、更新される accessPackageAssignment を識別する id プロパティが含まれています。

管理者が割り当ての削除を要求する場合、requestType プロパティの値は ですadminRemove割り当てプロパティには、削除される accessPackageAssignment を識別する id プロパティが含まれています。

管理者以外のユーザーが、最初の割り当てまたは割り当ての更新に対して独自の割り当てを作成するように要求する場合、 requestType プロパティの値は です userAdd割り当てプロパティには、 を持つ targetIdid オブジェクトが含まれます。 assignmentPolicyId プロパティは、accessPackageAssignmentPolicy を識別します。 accessPackageId プロパティは、accessPackage を識別します。 要求を行うユーザーは、ディレクトリに既に存在している必要があります。

管理者以外のユーザーが自分の割り当ての更新を要求する場合、 requestType プロパティの値は です userUpdate割り当てプロパティには、 targetId と ユーザーの がid含まれています。 assignmentPolicyId プロパティは、accessPackageAssignmentPolicy を識別します。 accessPackageId プロパティは、accessPackage を識別します。 要求を行うユーザーは、ディレクトリに既に存在している必要があります。

応答

成功した場合、このメソッドは応答本文に 200 シリーズの応答コードと新しい accessPackageAssignmentRequest オブジェクトを返します。

これが要求の adminAdd 場合は、その後 accessPackageAssignment が作成され、必要に応じて accessPackageSubject も作成されます。 accessPackageAssignments を一覧表示するときに、クエリ パラメーターを使用して検索できます。

例 1: 管理は、ディレクトリに既に存在するユーザーに対して直接割り当てを要求します

要求

次の例は、管理者がユーザーの割り当ての作成を要求する直接割り当ての要求を示しています。 accessPackageSubject はまだ存在しない可能性があるため、targetID の値は割り当てられているユーザーのオブジェクト ID、accessPackageId の値はそのユーザーの目的のアクセス パッケージであり、assignmentPolicyId の値はそのアクセス パッケージ内の直接割り当てポリシーです。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
  "requestType": "adminAdd",
  "assignment":{
     "targetId":"46184453-e63b-4f20-86c2-c557ed5d5df9",
     "assignmentPolicyId":"2264bf65-76ba-417b-a27d-54d291f0cbc8",
     "accessPackageId":"a914b616-e04e-476b-aa37-91038f0b165b"
  }
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 201 Created
Content-type: application/json

{
  "id": "46184453-e63b-4f20-86c2-c557ed5d5df9",
  "requestType": "adminAdd",
  "requestState": "Submitted",
  "requestStatus": "Accepted"
}

例 2: 割り当てを削除する

割り当てを削除するには、次の設定で新しい accessPackageAssignmentRequest オブジェクトを作成します。

  • requestType プロパティの値を に設定しますadminRemove
  • 割り当てプロパティに、削除する accessPackageAssignment オブジェクトの識別子を持つ オブジェクトを含めます。

要求

次の例は、割り当てを削除する方法を示しています。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
    "requestType": "adminRemove",
    "assignment":{
     "id": "a6bb6942-3ae1-4259-9908-0133aaee9377"
    }
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。 すべてのプロパティは、実際の呼び出しから返されます。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#accessPackageAssignmentRequests/$entity",
    "id": "78eaee8c-e6cf-48c9-8f99-aae44c35e379",
    "requestType": "adminRemove",
    "requestState": "Submitted",
    "requestStatus": "Accepted"
}

例 3: 質問に対する回答を提供して割り当てを要求する

次の例は、要求プロセス中にポリシーで必要な質問に回答することで、ユーザーがアクセス パッケージの割り当てを自分で要求する方法を示しています。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
    "@odata.type": "#microsoft.graph.accessPackageAssignmentRequest",
    "requestType": "userAdd",
    "answers": [
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "displayValue": "This is the answer to a multiple choice question",
            "value": "MultipleChoiceAnswerValue",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
                "id": "8fe745e7-80b2-490d-bd22-4e708c77288c"
            }
        },
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "This is my answer to a text input question.",
            "displayValue": "This is my answer.",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
                "id": "7aaa18c9-8e4f-440f-bd5a-3a7ce312cbe6"
            }
        }
    ],
    "assignment": {
        "accessPackageId": "977c7ff4-ef8f-4910-9d31-49048ddf3120"
    }
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。 すべてのプロパティは、実際の呼び出しから返されます。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#accessPackageAssignmentRequests/$entity",
    "id": "7a6ab703-0780-4b37-8445-81f679b2d75c",
    "requestType": "userAdd",
    "state": "submitted",
    "status": "Accepted",
    "createdDateTime": null,
    "completedDateTime": null,
    "schedule": {
        "startDateTime": null,
        "recurrence": null,
        "expiration": {
            "endDateTime": null,
            "duration": null,
            "type": "notSpecified"
        }
    },
    "answers": [
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "MultipleChoiceAnswerValue",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
                "id": "8fe745e7-80b2-490d-bd22-4e708c77288c"   
            },
            "displayValue": "This is the answer to a multiple choice question"
        },
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "This is my answer to a text input question.",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
                "id": "7aaa18c9-8e4f-440f-bd5a-3a7ce312cbe6"
            },
            "displayValue": "This is my answer."
        }
    ]
}

例 4: パッケージを要求し、正当な理由を提供する

次の例は、アクセス パッケージを要求し、承認者に正当な理由を提供する方法を示しています。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
    "requestType": "UserAdd",
    "accessPackageAssignment": {
        "accessPackageId": "a914b616-e04e-476b-aa37-91038f0b165b"
    },
    "justification":"Need access to New Hire access package"
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。 すべてのプロパティは、実際の呼び出しから返されます。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/assignmentRequests/$entity",
    "id": "9c1e258d-7723-43b1-ae21-e6eeeb324fe5",
    "requestType": "UserAdd",
    "requestState": "Submitted",
    "requestStatus": "Accepted",
    "createdDateTime": null,
    "completedDate": null,
    "justification": "Need access to New Hire access package",
    "isValidationOnly": false,
    "schedule": {
        "startDateTime": null,
        "recurrence": null,
        "expiration": {
            "endDateTime": null,
            "duration": null,
            "type": "notSpecified"
        }
    },
    "answers": [],
    "verifiedCredentialsData": [],
    "customExtensionHandlerInstances": [],
    "customExtensionCalloutInstances": []
}

例 5: 管理がまだディレクトリにいないユーザーに対して直接割り当てを要求する

要求

次の例は、直接割り当ての要求を示しています。この要求では、管理者はディレクトリに存在しないユーザーの割り当ての作成を要求します。 accessPackageId の値は、そのユーザーの目的のアクセス パッケージであり、assignmentPolicyId の値は、そのアクセス パッケージ内の直接割り当てポリシーです。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
  "requestType": "AdminAdd",
  "accessPackageAssignment":{
     "target": {
        "email": "user@contoso.com"
     },
     "assignmentPolicyId":"2264bf65-76ba-417b-a27d-54d291f0cbc8",
     "accessPackageId":"a914b616-e04e-476b-aa37-91038f0b165b"
  }
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/assignmentRequests/$entity",
    "id": "cb32aef9-2976-496d-9804-eb432fd894a7",
    "requestType": "AdminAdd",
    "requestState": "Submitted",
    "requestStatus": "Accepted",
    "createdDateTime": null,
    "completedDate": null,
    "justification": null,
    "isValidationOnly": false,
    "schedule": {
        "startDateTime": null,
        "recurrence": null,
        "expiration": {
            "endDateTime": null,
            "duration": null,
            "type": "notSpecified"
        }
    },
    "answers": [],
    "verifiedCredentialsData": [],
    "customExtensionHandlerInstances": [],
    "customExtensionCalloutInstances": []
}

例 6: 割り当ての回答の更新を要求する

次の例は、管理者が割り当ての更新を要求して、割り当ての要求中に回答された質問への応答を編集する方法を示しています。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/assignmentRequests
Content-type: application/json

{
    "@odata.type": "#microsoft.graph.accessPackageAssignmentRequest",
    "id": "7a6ab703-0780-4b37-8445-81f679b2d75c",
    "requestType": "adminUpdate",
    "answers": [
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "UpdatedAnswerValue",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
                "id": "8fe745e7-80b2-490d-bd22-4e708c77288c"
            }
        },
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "My updated answer.",
            "displayValue": "This is my updated answer to the question.",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
                "id": "7aaa18c9-8e4f-440f-bd5a-3a7ce312cbe6"
            }
        }
    ],
    "assignment": {
        "id": "44c741c1-2cf4-40db-83b6-e0112f8e5a83"
    }
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。 すべてのプロパティは、実際の呼び出しから返されます。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#accessPackageAssignmentRequests/$entity",
    "id": "0c471116-e439-40a6-8441-fe739dd48dab",
    "requestType": "adminUpdate",
    "state": "submitted",
    "status": "Accepted",
    "createdDateTime": null,
    "completedDateTime": null,
    "schedule": {
        "startDateTime": null,
        "recurrence": null,
        "expiration": {
            "endDateTime": null,
            "duration": null,
            "type": "notSpecified"
        }
    },
    "answers": [
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "UpdatedAnswerValue",
            "displayValue": "This is the answer to a multiple choice question",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
                "id": "8fe745e7-80b2-490d-bd22-4e708c77288c"   
            }         
        },
        {
            "@odata.type": "#microsoft.graph.accessPackageAnswerString",
            "value": "My updated answer.",
            "displayValue": "This is my updated answer to the question.",
            "answeredQuestion": {
                "@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
                "id": "7aaa18c9-8e4f-440f-bd5a-3a7ce312cbe6"
            }
        }
    ]
}