创建 accessPackageCustomWorkflowExtension

命名空间:microsoft.graph

创建新的 accessPackageAssignmentRequestWorkflowExtensionaccessPackageAssignmentWorkflowExtension 对象,并将其添加到现有 accessPackageCatalog 对象。

必须显式提供一个 @odata.type 属性,该属性指示对象是 accessPackageAssignmentRequestWorkflowExtension 还是 accessPackageAssignmentWorkflowExtension

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) EntitlementManagement.ReadWrite.All 不可用。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 EntitlementManagement.Read.All EntitlementManagement.ReadWrite.All 不可用。

提示

在具有工作或学校帐户的委托方案中,还必须通过以下选项之一为已登录用户分配具有支持的角色权限的管理员角色:

  • 在逻辑应用本身或更高范围(如资源组、订阅或管理组)上需要以下 Azure 角色 分配之一:
    • 逻辑应用参与者
    • 参与者
    • 所有者

以及以下其中一项:

在仅限应用的情况下,可为调用应用分配上述受支持的角色之一,而不是 EntitlementManagement.ReadWrite.All 应用程序权限。 目录所有者角色的特权低于EntitlementManagement.Read.All应用程序权限。 如果是在 logicAppTriggerEndpointConfiguration 中没有 URL 属性的委托调用,则调用方还需要在逻辑应用上获得授权。

有关详细信息,请参阅 权利管理中的委派和角色 以及如何 在权利管理中将访问管理委托给访问包管理员

HTTP 请求

POST /identityGovernance/entitlementManagement/catalogs/{catalogId}/customWorkflowExtensions

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
Content-Type application/json. 必需。

请求正文

在请求正文中,提供 accessPackageAssignmentRequestWorkflowExtensionaccessPackageAssignmentWorkflowExtension 对象的 JSON 表示形式。

创建 accessPackageCustomWorkflowExtension 时,可以指定以下属性。

属性 类型 说明
说明 String customAccessPackageWorkflowExtension 对象的说明。
displayName String 必填。 customAccessPackageWorkflowExtension 的显示名称。
endpointConfiguration customExtensionEndpointConfiguration 必填。 用于配置终结点以调用逻辑应用的工作流的类型和详细信息。
authenticationConfiguration customExtensionAuthenticationConfiguration 必填。 用于保护对逻辑应用的 API 调用的配置。 例如,使用 OAuth 客户端凭据流。
callbackConfiguration customExtensionCallbackConfiguration 自定义扩展的回调配置。 支持此操作 accessPackageAssignmentRequestWorkflowExtension

还必须提供具有特定访问包工作流扩展类型的值的 @odata.type 属性。 例如,"@odata.type": "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension"

响应

如果成功,此方法在 201 Created 响应正文中返回响应代码和 accessPackageAssignmentRequestWorkflowExtensionaccessPackageAssignmentWorkflowExtension 对象。

示例

示例 1:创建用于访问包分配请求的自定义扩展

下面是访问包分配请求自定义工作流扩展的示例。

请求

POST https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/32efb28c-9a7a-446c-986b-ca6528c6669d/customWorkflowExtensions
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension",
  "displayName": "test_action_0124_email",
  "description": "this is for graph testing only",
  "endpointConfiguration": {
    "@odata.type": "#microsoft.graph.logicAppTriggerEndpointConfiguration",
    "subscriptionId": "38ab2ccc-3747-4567-b36b-9478f5602f0d",
    "resourceGroupName": "test",
    "logicAppWorkflowName": "elm-extension-email"
  },
  "authenticationConfiguration": {
    "@odata.type": "#microsoft.graph.azureAdPopTokenAuthentication"
  },
  "callbackConfiguration": {
    "@odata.type": "microsoft.graph.customExtensionCallbackConfiguration",
    "durationBeforeTimeout": "PT1H"
  }
}

响应

注意:为了提高可读性,可能缩短了此处显示的响应对象。

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

{
   "value":{
      "@odata.type":"#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension",
      "id":"98ffaec5-ae8e-4902-a434-5ffc5d3d3cd0",
      "displayName":"test_action_0124_email",
      "description":"this is for graph testing only",
      "createdDateTime":"2022-01-24T21:48:57.15Z",
      "lastModifiedDateTime":"2022-01-24T21:55:44.953Z",
      "clientConfiguration":null,
      "endpointConfiguration":{
         "@odata.type":"#microsoft.graph.logicAppTriggerEndpointConfiguration",
         "subscriptionId":"38ab2ccc-3747-4567-b36b-9478f5602f0d",
         "resourceGroupName":"test",
         "logicAppWorkflowName":"elm-extension-email",
         "url":"https://prod-31.eastus.logic.azure.com:443/workflows/8ccffea766ae48e680gd9a22d1549bbc/triggers/manual/paths/invoke?api-version=2016-10-01"
      },
      "authenticationConfiguration":{
         "@odata.type":"#microsoft.graph.azureAdPopTokenAuthentication"
      },
      "callbackConfiguration":{
         "@odata.type":"microsoft.graph.customExtensionCallbackConfiguration",
         "durationBeforeTimeout":"PT1H"
      }
   }
}

示例 2:创建用于访问包分配的自定义扩展

下面是访问包分配自定义工作流扩展的示例。

请求

POST https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/32efb28c-9a7a-446c-986b-ca6528c6669d/customWorkflowExtensions
Content-Type: application/json

{
   "value":{
      "@odata.type":"#microsoft.graph.accessPackageAssignmentWorkflowExtension",
      "displayName":"test_action_0127_email",
      "description":"this is for graph testing only",
      "endpointConfiguration":{
         "@odata.type":"#microsoft.graph.logicAppTriggerEndpointConfiguration",
         "subscriptionId":"38ab2ccc-3747-4567-b36b-9478f5602f0d",
         "resourceGroupName":"test",
         "logicAppWorkflowName":"elm-extension-email"
      },
      "authenticationConfiguration":{
         "@odata.type":"#microsoft.graph.azureAdPopTokenAuthentication"
      }
   }
}

响应

注意:为了提高可读性,可能缩短了此处显示的响应对象。

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

{
   "value":{
      "@odata.type":"#microsoft.graph.accessPackageAssignmentWorkflowExtension",
      "id":"78ffaec5-ae8e-4902-a434-5ffc5d3d3cd0",
      "displayName":"test_action_0127_email",
      "description":"this is for graph testing only",
      "createdDateTime":"2022-01-24T21:48:57.15Z",
      "lastModifiedDateTime":"2022-01-24T21:55:44.953Z",
      "clientConfiguration":null,
      "endpointConfiguration":{
         "@odata.type":"#microsoft.graph.logicAppTriggerEndpointConfiguration",
         "subscriptionId":"38ab2ccc-3747-4567-b36b-9478f5602f0d",
         "resourceGroupName":"test",
         "logicAppWorkflowName":"elm-extension-email",
         "url":"https://prod-31.eastus.logic.azure.com:443/workflows/7ccffea766ae48e680gd9a22d1549bbc/triggers/manual/paths/invoke?api-version=2016-10-01"
      },
      "authenticationConfiguration":{
         "@odata.type":"#microsoft.graph.azureAdPopTokenAuthentication"
      }
   }
}