命名空间:microsoft.graph
创建新的 accessPackageAssignmentRequestWorkflowExtension 或 accessPackageAssignmentWorkflowExtension 对象,并将其添加到现有 accessPackageCatalog 对象。
必须显式提供一个 @odata.type
属性,该属性指示对象是 accessPackageAssignmentRequestWorkflowExtension 还是 accessPackageAssignmentWorkflowExtension。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
EntitlementManagement.ReadWrite.All |
不可用。 |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
EntitlementManagement.Read.All EntitlementManagement.ReadWrite.All |
不可用。 |
HTTP 请求
POST /identityGovernance/entitlementManagement/catalogs/{catalogId}/customWorkflowExtensions
名称 |
说明 |
Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
Content-Type |
application/json. 必需。 |
请求正文
在请求正文中,提供 accessPackageAssignmentRequestWorkflowExtension 或 accessPackageAssignmentWorkflowExtension 对象的 JSON 表示形式。
创建 accessPackageCustomWorkflowExtension 时,可以指定以下属性。
还必须提供具有特定访问包工作流扩展类型的值的 @odata.type 属性。 例如,"@odata.type": "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension"
。
响应
如果成功,此方法在 201 Created
响应正文中返回响应代码和 accessPackageAssignmentRequestWorkflowExtension 或 accessPackageAssignmentWorkflowExtension 对象。
示例
示例 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"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AccessPackageAssignmentRequestWorkflowExtension
{
OdataType = "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension",
DisplayName = "test_action_0124_email",
Description = "this is for graph testing only",
EndpointConfiguration = new LogicAppTriggerEndpointConfiguration
{
OdataType = "#microsoft.graph.logicAppTriggerEndpointConfiguration",
SubscriptionId = "38ab2ccc-3747-4567-b36b-9478f5602f0d",
ResourceGroupName = "test",
LogicAppWorkflowName = "elm-extension-email",
},
AuthenticationConfiguration = new AzureAdPopTokenAuthentication
{
OdataType = "#microsoft.graph.azureAdPopTokenAuthentication",
},
CallbackConfiguration = new CustomExtensionCallbackConfiguration
{
OdataType = "microsoft.graph.customExtensionCallbackConfiguration",
AdditionalData = new Dictionary<string, object>
{
{
"durationBeforeTimeout" , "PT1H"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].CustomWorkflowExtensions.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc identity-governance entitlement-management catalogs custom-workflow-extensions create --access-package-catalog-id {accessPackageCatalog-id} --body '{\
"@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"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCustomCalloutExtension()
displayName := "test_action_0124_email"
requestBody.SetDisplayName(&displayName)
description := "this is for graph testing only"
requestBody.SetDescription(&description)
endpointConfiguration := graphmodels.NewLogicAppTriggerEndpointConfiguration()
subscriptionId := "38ab2ccc-3747-4567-b36b-9478f5602f0d"
endpointConfiguration.SetSubscriptionId(&subscriptionId)
resourceGroupName := "test"
endpointConfiguration.SetResourceGroupName(&resourceGroupName)
logicAppWorkflowName := "elm-extension-email"
endpointConfiguration.SetLogicAppWorkflowName(&logicAppWorkflowName)
requestBody.SetEndpointConfiguration(endpointConfiguration)
authenticationConfiguration := graphmodels.NewAzureAdPopTokenAuthentication()
requestBody.SetAuthenticationConfiguration(authenticationConfiguration)
callbackConfiguration := graphmodels.NewCustomExtensionCallbackConfiguration()
additionalData := map[string]interface{}{
"durationBeforeTimeout" : "PT1H",
}
callbackConfiguration.SetAdditionalData(additionalData)
requestBody.SetCallbackConfiguration(callbackConfiguration)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customWorkflowExtensions, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").CustomWorkflowExtensions().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentRequestWorkflowExtension customCalloutExtension = new AccessPackageAssignmentRequestWorkflowExtension();
customCalloutExtension.setOdataType("#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension");
customCalloutExtension.setDisplayName("test_action_0124_email");
customCalloutExtension.setDescription("this is for graph testing only");
LogicAppTriggerEndpointConfiguration endpointConfiguration = new LogicAppTriggerEndpointConfiguration();
endpointConfiguration.setOdataType("#microsoft.graph.logicAppTriggerEndpointConfiguration");
endpointConfiguration.setSubscriptionId("38ab2ccc-3747-4567-b36b-9478f5602f0d");
endpointConfiguration.setResourceGroupName("test");
endpointConfiguration.setLogicAppWorkflowName("elm-extension-email");
customCalloutExtension.setEndpointConfiguration(endpointConfiguration);
AzureAdPopTokenAuthentication authenticationConfiguration = new AzureAdPopTokenAuthentication();
authenticationConfiguration.setOdataType("#microsoft.graph.azureAdPopTokenAuthentication");
customCalloutExtension.setAuthenticationConfiguration(authenticationConfiguration);
CustomExtensionCallbackConfiguration callbackConfiguration = new CustomExtensionCallbackConfiguration();
callbackConfiguration.setOdataType("microsoft.graph.customExtensionCallbackConfiguration");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("durationBeforeTimeout", "PT1H");
callbackConfiguration.setAdditionalData(additionalData);
customCalloutExtension.setCallbackConfiguration(callbackConfiguration);
CustomCalloutExtension result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").customWorkflowExtensions().post(customCalloutExtension);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const customCalloutExtension = {
'@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'
}
};
await client.api('/identityGovernance/entitlementManagement/catalogs/32efb28c-9a7a-446c-986b-ca6528c6669d/customWorkflowExtensions')
.post(customCalloutExtension);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AccessPackageAssignmentRequestWorkflowExtension;
use Microsoft\Graph\Generated\Models\LogicAppTriggerEndpointConfiguration;
use Microsoft\Graph\Generated\Models\AzureAdPopTokenAuthentication;
use Microsoft\Graph\Generated\Models\CustomExtensionCallbackConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageAssignmentRequestWorkflowExtension();
$requestBody->setOdataType('#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension');
$requestBody->setDisplayName('test_action_0124_email');
$requestBody->setDescription('this is for graph testing only');
$endpointConfiguration = new LogicAppTriggerEndpointConfiguration();
$endpointConfiguration->setOdataType('#microsoft.graph.logicAppTriggerEndpointConfiguration');
$endpointConfiguration->setSubscriptionId('38ab2ccc-3747-4567-b36b-9478f5602f0d');
$endpointConfiguration->setResourceGroupName('test');
$endpointConfiguration->setLogicAppWorkflowName('elm-extension-email');
$requestBody->setEndpointConfiguration($endpointConfiguration);
$authenticationConfiguration = new AzureAdPopTokenAuthentication();
$authenticationConfiguration->setOdataType('#microsoft.graph.azureAdPopTokenAuthentication');
$requestBody->setAuthenticationConfiguration($authenticationConfiguration);
$callbackConfiguration = new CustomExtensionCallbackConfiguration();
$callbackConfiguration->setOdataType('microsoft.graph.customExtensionCallbackConfiguration');
$additionalData = [
'durationBeforeTimeout' => 'PT1H',
];
$callbackConfiguration->setAdditionalData($additionalData);
$requestBody->setCallbackConfiguration($callbackConfiguration);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->catalogs()->byAccessPackageCatalogId('accessPackageCatalog-id')->customWorkflowExtensions()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
"@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"
}
}
New-MgEntitlementManagementCatalogCustomWorkflowExtension -AccessPackageCatalogId $accessPackageCatalogId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.access_package_assignment_request_workflow_extension import AccessPackageAssignmentRequestWorkflowExtension
from msgraph.generated.models.logic_app_trigger_endpoint_configuration import LogicAppTriggerEndpointConfiguration
from msgraph.generated.models.azure_ad_pop_token_authentication import AzureAdPopTokenAuthentication
from msgraph.generated.models.custom_extension_callback_configuration import CustomExtensionCallbackConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageAssignmentRequestWorkflowExtension(
odata_type = "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension",
display_name = "test_action_0124_email",
description = "this is for graph testing only",
endpoint_configuration = LogicAppTriggerEndpointConfiguration(
odata_type = "#microsoft.graph.logicAppTriggerEndpointConfiguration",
subscription_id = "38ab2ccc-3747-4567-b36b-9478f5602f0d",
resource_group_name = "test",
logic_app_workflow_name = "elm-extension-email",
),
authentication_configuration = AzureAdPopTokenAuthentication(
odata_type = "#microsoft.graph.azureAdPopTokenAuthentication",
),
callback_configuration = CustomExtensionCallbackConfiguration(
odata_type = "microsoft.graph.customExtensionCallbackConfiguration",
additional_data = {
"duration_before_timeout" : "PT1H",
}
),
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').custom_workflow_extensions.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
注意:为了提高可读性,可能缩短了此处显示的响应对象。
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"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new CustomCalloutExtension
{
AdditionalData = new Dictionary<string, object>
{
{
"value" , new AccessPackageAssignmentWorkflowExtension
{
OdataType = "#microsoft.graph.accessPackageAssignmentWorkflowExtension",
DisplayName = "test_action_0127_email",
Description = "this is for graph testing only",
EndpointConfiguration = new LogicAppTriggerEndpointConfiguration
{
OdataType = "#microsoft.graph.logicAppTriggerEndpointConfiguration",
SubscriptionId = "38ab2ccc-3747-4567-b36b-9478f5602f0d",
ResourceGroupName = "test",
LogicAppWorkflowName = "elm-extension-email",
},
AuthenticationConfiguration = new AzureAdPopTokenAuthentication
{
OdataType = "#microsoft.graph.azureAdPopTokenAuthentication",
},
}
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].CustomWorkflowExtensions.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc identity-governance entitlement-management catalogs custom-workflow-extensions create --access-package-catalog-id {accessPackageCatalog-id} --body '{\
"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"\
}\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCustomCalloutExtension()
additionalData := map[string]interface{}{
value := graphmodels.NewAccessPackageAssignmentWorkflowExtension()
displayName := "test_action_0127_email"
value.SetDisplayName(&displayName)
description := "this is for graph testing only"
value.SetDescription(&description)
endpointConfiguration := graphmodels.NewLogicAppTriggerEndpointConfiguration()
subscriptionId := "38ab2ccc-3747-4567-b36b-9478f5602f0d"
endpointConfiguration.SetSubscriptionId(&subscriptionId)
resourceGroupName := "test"
endpointConfiguration.SetResourceGroupName(&resourceGroupName)
logicAppWorkflowName := "elm-extension-email"
endpointConfiguration.SetLogicAppWorkflowName(&logicAppWorkflowName)
value.SetEndpointConfiguration(endpointConfiguration)
authenticationConfiguration := graphmodels.NewAzureAdPopTokenAuthentication()
value.SetAuthenticationConfiguration(authenticationConfiguration)
requestBody.SetValue(value)
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customWorkflowExtensions, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").CustomWorkflowExtensions().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CustomCalloutExtension customCalloutExtension = new CustomCalloutExtension();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
AccessPackageAssignmentWorkflowExtension value = new AccessPackageAssignmentWorkflowExtension();
value.setOdataType("#microsoft.graph.accessPackageAssignmentWorkflowExtension");
value.setDisplayName("test_action_0127_email");
value.setDescription("this is for graph testing only");
LogicAppTriggerEndpointConfiguration endpointConfiguration = new LogicAppTriggerEndpointConfiguration();
endpointConfiguration.setOdataType("#microsoft.graph.logicAppTriggerEndpointConfiguration");
endpointConfiguration.setSubscriptionId("38ab2ccc-3747-4567-b36b-9478f5602f0d");
endpointConfiguration.setResourceGroupName("test");
endpointConfiguration.setLogicAppWorkflowName("elm-extension-email");
value.setEndpointConfiguration(endpointConfiguration);
AzureAdPopTokenAuthentication authenticationConfiguration = new AzureAdPopTokenAuthentication();
authenticationConfiguration.setOdataType("#microsoft.graph.azureAdPopTokenAuthentication");
value.setAuthenticationConfiguration(authenticationConfiguration);
additionalData.put("value", value);
customCalloutExtension.setAdditionalData(additionalData);
CustomCalloutExtension result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").customWorkflowExtensions().post(customCalloutExtension);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const customCalloutExtension = {
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'
}
}
};
await client.api('/identityGovernance/entitlementManagement/catalogs/32efb28c-9a7a-446c-986b-ca6528c6669d/customWorkflowExtensions')
.post(customCalloutExtension);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\CustomCalloutExtension;
use Microsoft\Graph\Generated\Models\AccessPackageAssignmentWorkflowExtension;
use Microsoft\Graph\Generated\Models\LogicAppTriggerEndpointConfiguration;
use Microsoft\Graph\Generated\Models\AzureAdPopTokenAuthentication;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CustomCalloutExtension();
$additionalData = [
'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',
],
],
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->catalogs()->byAccessPackageCatalogId('accessPackageCatalog-id')->customWorkflowExtensions()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
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"
}
}
}
New-MgEntitlementManagementCatalogCustomWorkflowExtension -AccessPackageCatalogId $accessPackageCatalogId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.custom_callout_extension import CustomCalloutExtension
from msgraph.generated.models.access_package_assignment_workflow_extension import AccessPackageAssignmentWorkflowExtension
from msgraph.generated.models.logic_app_trigger_endpoint_configuration import LogicAppTriggerEndpointConfiguration
from msgraph.generated.models.azure_ad_pop_token_authentication import AzureAdPopTokenAuthentication
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CustomCalloutExtension(
additional_data = {
"value" : {
"@odata_type" : "#microsoft.graph.accessPackageAssignmentWorkflowExtension",
"display_name" : "test_action_0127_email",
"description" : "this is for graph testing only",
"endpoint_configuration" : {
"@odata_type" : "#microsoft.graph.logicAppTriggerEndpointConfiguration",
"subscription_id" : "38ab2ccc-3747-4567-b36b-9478f5602f0d",
"resource_group_name" : "test",
"logic_app_workflow_name" : "elm-extension-email",
},
"authentication_configuration" : {
"@odata_type" : "#microsoft.graph.azureAdPopTokenAuthentication",
},
},
}
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').custom_workflow_extensions.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
注意:为了提高可读性,可能缩短了此处显示的响应对象。
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"
}
}
}