APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Create a new accessPackageResourceRequest object to request the addition of a resource to an access package catalog, update of a resource, or the removal of a resource from a catalog. A resource must be included in an access package catalog before a role of that resource can be added to an access package.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
EntitlementManagement.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
EntitlementManagement.ReadWrite.All
Not available.
Tip
In delegated scenarios with work or school accounts, the signed-in user must also be assigned an administrator role with supported role permissions through one of the following options:
In app-only scenarios, the calling app can be assigned one of the preceding supported roles instead of the EntitlementManagement.ReadWrite.All application permission. The Catalog owner role is less privileged than the EntitlementManagement.ReadWrite.All application permission.
Additionally you must also have the following permissions on the resource being added:
To add a Microsoft Entra group as a resource to a catalog:
If using delegated permissions, the user requesting to add a group should be an owner of the group or in a directory role that allows them to modify groups.
If using application permissions, the application requesting to add the group should also be assigned the Group.ReadWrite.All permission.
To add a Microsoft Entra application as a resource to a catalog:
If using delegated permissions, the user requesting to add an application should be an owner of the application or in a directory role that allows them to modify application role assignments.
If using application permissions, the application requesting to add the servicePrincipal should also be assigned the Application.ReadWrite.All permission.
To add a SharePoint Online site as a resource to a catalog:
If using delegated permissions, the user who wants to add the site should be in a role that allows them to modify the SharePoint site roles, such as the SharePoint Administrator role.
In the request body, supply a JSON representation of an accessPackageResourceRequest object. Include the accessPackageResource relationship with an accessPackageResource object as part of the request.
To add a Microsoft Entra group as a resource to a catalog, set the catalogId to be of the ID of the catalog, requestType to be AdminAdd, and an accessPackageResource representing the resource. The value of the originSystem property within the accessPackageResource should be AadGroup and the value of the originId is the identifier of the group. If using delegated permissions, the user requesting to add a group should be an owner of the group or in a directory role which allows them to modify groups. If using application permissions, the application requesting to add the group should also be assigned the Group.ReadWrite.All permission.
To add a Microsoft Entra application as a resource to a catalog, set the catalogId to be of the ID of the catalog, requestType to be AdminAdd, and an accessPackageResource representing the resource. The value of the originSystem property within the accessPackageResource should be AadApplication and the value of the originId is the identifier of the servicePrincipal. If using delegated permissions, the user requesting to add an application should be an owner of the application or in a directory role which allows them to modify application role assignments.
To add a SharePoint Online site as a resource to a catalog, set the catalogId to be of the ID of the catalog, requestType to be AdminAdd, and an accessPackageResource representing the resource. The value of the originSystem property within the accessPackageResource should be SharePointOnline and the value of the originId is the URI of the site. If using delegated permissions, the user should be in the the SharePoint Administrator role. If using application permissions, the application requesting to add the site should also be assigned the Sites.FullControl.All permission. To assign the geolocation environment for a multi-geolocation Sharepoint Online resource, include the accessPackageResourceEnvironment relationship in the accessPackageResource object. This can be done in two ways:
Use @odata.bind annotation to assign the id of the accessPackageResourceEnvironment to an accessPackageResourceEnvironment object.
Specify the originId parameter of the accessPackageResourceEnvironment in an accessPackageResourceEnvironment object.
To remove a resource from a catalog, set the catalogId to be of the ID of the catalog, requestType to be AdminRemove, and the accessPackageResource the resource object to be removed. The resource object can be retrieved using list accessPackageResources.
Response
If successful, this method returns a 201 Created response code and a new accessPackageResourceRequest object in the response body.
Examples
Example 1: Create an accessPackageResourceRequest for adding a site as a resource
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
RequestType = "AdminAdd",
Justification = "",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Sales",
Description = "https://contoso.sharepoint.com/sites/Sales",
Url = "https://contoso.sharepoint.com/sites/Sales",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/Sales",
OriginSystem = "SharePointOnline",
},
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "26ac0c0a-08bc-4a7b-a313-839f58044ba5"
requestBody.SetCatalogId(&catalogId)
requestType := "AdminAdd"
requestBody.SetRequestType(&requestType)
justification := ""
requestBody.SetJustification(&justification)
accessPackageResource := graphmodels.NewAccessPackageResource()
displayName := "Sales"
accessPackageResource.SetDisplayName(&displayName)
description := "https://contoso.sharepoint.com/sites/Sales"
accessPackageResource.SetDescription(&description)
url := "https://contoso.sharepoint.com/sites/Sales"
accessPackageResource.SetUrl(&url)
resourceType := "SharePoint Online Site"
accessPackageResource.SetResourceType(&resourceType)
originId := "https://contoso.sharepoint.com/sites/Sales"
accessPackageResource.SetOriginId(&originId)
originSystem := "SharePointOnline"
accessPackageResource.SetOriginSystem(&originSystem)
requestBody.SetAccessPackageResource(accessPackageResource)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("26ac0c0a-08bc-4a7b-a313-839f58044ba5");
accessPackageResourceRequest.setRequestType("AdminAdd");
accessPackageResourceRequest.setJustification("");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Sales");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setUrl("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setOriginSystem("SharePointOnline");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('26ac0c0a-08bc-4a7b-a313-839f58044ba5');
$requestBody->setRequestType('AdminAdd');
$requestBody->setJustification('');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setDisplayName('Sales');
$accessPackageResource->setDescription('https://contoso.sharepoint.com/sites/Sales');
$accessPackageResource->setUrl('https://contoso.sharepoint.com/sites/Sales');
$accessPackageResource->setResourceType('SharePoint Online Site');
$accessPackageResource->setOriginId('https://contoso.sharepoint.com/sites/Sales');
$accessPackageResource->setOriginSystem('SharePointOnline');
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
request_type = "AdminAdd",
justification = "",
access_package_resource = AccessPackageResource(
display_name = "Sales",
description = "https://contoso.sharepoint.com/sites/Sales",
url = "https://contoso.sharepoint.com/sites/Sales",
resource_type = "SharePoint Online Site",
origin_id = "https://contoso.sharepoint.com/sites/Sales",
origin_system = "SharePointOnline",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Example 2: Create an accessPackageResourceRequest for adding a site as a resource and assign an accessPackageResourceEnvironment using @odata.bind
Request
The following example shows a request. In this example, the @odata.bind annotation is used to assign the id of the accessPackageResourceEnvironment to an accessPackageResourceEnvironment object.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "de9315c1-272b-4905-924b-cc112ca180c7",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Community Outreach",
Description = "https://contoso.sharepoint.com/sites/CSR",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/CSR",
OriginSystem = "SharePointOnline",
AdditionalData = new Dictionary<string, object>
{
{
"[email protected]" , "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57"
},
},
},
RequestType = "AdminAdd",
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "de9315c1-272b-4905-924b-cc112ca180c7"
requestBody.SetCatalogId(&catalogId)
accessPackageResource := graphmodels.NewAccessPackageResource()
displayName := "Community Outreach"
accessPackageResource.SetDisplayName(&displayName)
description := "https://contoso.sharepoint.com/sites/CSR"
accessPackageResource.SetDescription(&description)
resourceType := "SharePoint Online Site"
accessPackageResource.SetResourceType(&resourceType)
originId := "https://contoso.sharepoint.com/sites/CSR"
accessPackageResource.SetOriginId(&originId)
originSystem := "SharePointOnline"
accessPackageResource.SetOriginSystem(&originSystem)
additionalData := map[string]interface{}{
"[email protected]" : "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57",
}
accessPackageResource.SetAdditionalData(additionalData)
requestBody.SetAccessPackageResource(accessPackageResource)
requestType := "AdminAdd"
requestBody.SetRequestType(&requestType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("de9315c1-272b-4905-924b-cc112ca180c7");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Community Outreach");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setOriginSystem("SharePointOnline");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("[email protected]", "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57");
accessPackageResource.setAdditionalData(additionalData);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('de9315c1-272b-4905-924b-cc112ca180c7');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setDisplayName('Community Outreach');
$accessPackageResource->setDescription('https://contoso.sharepoint.com/sites/CSR');
$accessPackageResource->setResourceType('SharePoint Online Site');
$accessPackageResource->setOriginId('https://contoso.sharepoint.com/sites/CSR');
$accessPackageResource->setOriginSystem('SharePointOnline');
$additionalData = [
'[email protected]' => 'accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57',
];
$accessPackageResource->setAdditionalData($additionalData);
$requestBody->setAccessPackageResource($accessPackageResource);
$requestBody->setRequestType('AdminAdd');
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "de9315c1-272b-4905-924b-cc112ca180c7",
access_package_resource = AccessPackageResource(
display_name = "Community Outreach",
description = "https://contoso.sharepoint.com/sites/CSR",
resource_type = "SharePoint Online Site",
origin_id = "https://contoso.sharepoint.com/sites/CSR",
origin_system = "SharePointOnline",
additional_data = {
"access_package_resource_environment@odata_bind" : "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57",
}
),
request_type = "AdminAdd",
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Example 3: Create an accessPackageResourceRequest for adding a site as a resource and assign an accessPackageResourceEnvironment using originId
Request
The following example shows a request. In this example, the parameters of an accessPackageResourceEnvironment are specified in an accessPackageResourceEnvironment object.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "de9315c1-272b-4905-924b-cc112ca180c7",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Community Outreach",
Description = "https://contoso.sharepoint.com/sites/CSR",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/CSR",
OriginSystem = "SharePointOnline",
AccessPackageResourceEnvironment = new AccessPackageResourceEnvironment
{
OriginId = "https://contoso-admin.sharepoint.com/",
},
},
RequestType = "AdminAdd",
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "de9315c1-272b-4905-924b-cc112ca180c7"
requestBody.SetCatalogId(&catalogId)
accessPackageResource := graphmodels.NewAccessPackageResource()
displayName := "Community Outreach"
accessPackageResource.SetDisplayName(&displayName)
description := "https://contoso.sharepoint.com/sites/CSR"
accessPackageResource.SetDescription(&description)
resourceType := "SharePoint Online Site"
accessPackageResource.SetResourceType(&resourceType)
originId := "https://contoso.sharepoint.com/sites/CSR"
accessPackageResource.SetOriginId(&originId)
originSystem := "SharePointOnline"
accessPackageResource.SetOriginSystem(&originSystem)
accessPackageResourceEnvironment := graphmodels.NewAccessPackageResourceEnvironment()
originId := "https://contoso-admin.sharepoint.com/"
accessPackageResourceEnvironment.SetOriginId(&originId)
accessPackageResource.SetAccessPackageResourceEnvironment(accessPackageResourceEnvironment)
requestBody.SetAccessPackageResource(accessPackageResource)
requestType := "AdminAdd"
requestBody.SetRequestType(&requestType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("de9315c1-272b-4905-924b-cc112ca180c7");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Community Outreach");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setOriginSystem("SharePointOnline");
AccessPackageResourceEnvironment accessPackageResourceEnvironment = new AccessPackageResourceEnvironment();
accessPackageResourceEnvironment.setOriginId("https://contoso-admin.sharepoint.com/");
accessPackageResource.setAccessPackageResourceEnvironment(accessPackageResourceEnvironment);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceEnvironment;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('de9315c1-272b-4905-924b-cc112ca180c7');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setDisplayName('Community Outreach');
$accessPackageResource->setDescription('https://contoso.sharepoint.com/sites/CSR');
$accessPackageResource->setResourceType('SharePoint Online Site');
$accessPackageResource->setOriginId('https://contoso.sharepoint.com/sites/CSR');
$accessPackageResource->setOriginSystem('SharePointOnline');
$accessPackageResourceAccessPackageResourceEnvironment = new AccessPackageResourceEnvironment();
$accessPackageResourceAccessPackageResourceEnvironment->setOriginId('https://contoso-admin.sharepoint.com/');
$accessPackageResource->setAccessPackageResourceEnvironment($accessPackageResourceAccessPackageResourceEnvironment);
$requestBody->setAccessPackageResource($accessPackageResource);
$requestBody->setRequestType('AdminAdd');
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
from msgraph_beta.generated.models.access_package_resource_environment import AccessPackageResourceEnvironment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "de9315c1-272b-4905-924b-cc112ca180c7",
access_package_resource = AccessPackageResource(
display_name = "Community Outreach",
description = "https://contoso.sharepoint.com/sites/CSR",
resource_type = "SharePoint Online Site",
origin_id = "https://contoso.sharepoint.com/sites/CSR",
origin_system = "SharePointOnline",
access_package_resource_environment = AccessPackageResourceEnvironment(
origin_id = "https://contoso-admin.sharepoint.com/",
),
),
request_type = "AdminAdd",
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "beedadfe-01d5-4025-910b-84abb9369997",
RequestType = "AdminAdd",
AccessPackageResource = new AccessPackageResource
{
OriginId = "c6294667-7348-4f5a-be73-9d2c65f574f3",
OriginSystem = "AadGroup",
},
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "beedadfe-01d5-4025-910b-84abb9369997"
requestBody.SetCatalogId(&catalogId)
requestType := "AdminAdd"
requestBody.SetRequestType(&requestType)
accessPackageResource := graphmodels.NewAccessPackageResource()
originId := "c6294667-7348-4f5a-be73-9d2c65f574f3"
accessPackageResource.SetOriginId(&originId)
originSystem := "AadGroup"
accessPackageResource.SetOriginSystem(&originSystem)
requestBody.SetAccessPackageResource(accessPackageResource)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("beedadfe-01d5-4025-910b-84abb9369997");
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setOriginId("c6294667-7348-4f5a-be73-9d2c65f574f3");
accessPackageResource.setOriginSystem("AadGroup");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('beedadfe-01d5-4025-910b-84abb9369997');
$requestBody->setRequestType('AdminAdd');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setOriginId('c6294667-7348-4f5a-be73-9d2c65f574f3');
$accessPackageResource->setOriginSystem('AadGroup');
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "beedadfe-01d5-4025-910b-84abb9369997",
request_type = "AdminAdd",
access_package_resource = AccessPackageResource(
origin_id = "c6294667-7348-4f5a-be73-9d2c65f574f3",
origin_system = "AadGroup",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "beedadfe-01d5-4025-910b-84abb9369997",
RequestType = "AdminRemove",
AccessPackageResource = new AccessPackageResource
{
Id = "354078e5-dbce-4894-8af4-0ab274d41662",
},
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "beedadfe-01d5-4025-910b-84abb9369997"
requestBody.SetCatalogId(&catalogId)
requestType := "AdminRemove"
requestBody.SetRequestType(&requestType)
accessPackageResource := graphmodels.NewAccessPackageResource()
id := "354078e5-dbce-4894-8af4-0ab274d41662"
accessPackageResource.SetId(&id)
requestBody.SetAccessPackageResource(accessPackageResource)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("beedadfe-01d5-4025-910b-84abb9369997");
accessPackageResourceRequest.setRequestType("AdminRemove");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setId("354078e5-dbce-4894-8af4-0ab274d41662");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('beedadfe-01d5-4025-910b-84abb9369997');
$requestBody->setRequestType('AdminRemove');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setId('354078e5-dbce-4894-8af4-0ab274d41662');
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "beedadfe-01d5-4025-910b-84abb9369997",
request_type = "AdminRemove",
access_package_resource = AccessPackageResource(
id = "354078e5-dbce-4894-8af4-0ab274d41662",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
RequestType = "AdminAdd",
Justification = "",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Faculty cafeteria ordering",
Description = "Example application",
Url = "https://myapps.microsoft.com/example.com/signin/Faculty%20cafeteria%20ordering/f1e3b407-942d-4934-9a3f-cef1975cb988/",
ResourceType = "Application",
OriginId = "2f1099a6-d4fc-4cc9-a0ef-ddd3f1bf0b7e",
OriginSystem = "AadApplication",
Attributes = new List<AccessPackageResourceAttribute>
{
new AccessPackageResourceAttribute
{
AttributeName = "extension_2b676109c7c74ae2b41549205f1947ed_personalTitle",
IsEditable = true,
IsPersistedOnAssignmentRemoval = true,
AttributeSource = new AccessPackageResourceAttributeQuestion
{
OdataType = "#microsoft.graph.accessPackageResourceAttributeQuestion",
Question = new AccessPackageTextInputQuestion
{
OdataType = "#microsoft.graph.accessPackageTextInputQuestion",
IsRequired = false,
Sequence = 0,
IsSingleLineQuestion = true,
Text = new AccessPackageLocalizedContent
{
DefaultText = "Title",
LocalizedTexts = new List<AccessPackageLocalizedText>
{
},
},
},
},
AttributeDestination = new AccessPackageUserDirectoryAttributeStore
{
OdataType = "#microsoft.graph.accessPackageUserDirectoryAttributeStore",
},
},
},
},
};
// 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.AccessPackageResourceRequests.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("26ac0c0a-08bc-4a7b-a313-839f58044ba5");
accessPackageResourceRequest.setRequestType("AdminAdd");
accessPackageResourceRequest.setJustification("");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Faculty cafeteria ordering");
accessPackageResource.setDescription("Example application");
accessPackageResource.setUrl("https://myapps.microsoft.com/example.com/signin/Faculty%20cafeteria%20ordering/f1e3b407-942d-4934-9a3f-cef1975cb988/");
accessPackageResource.setResourceType("Application");
accessPackageResource.setOriginId("2f1099a6-d4fc-4cc9-a0ef-ddd3f1bf0b7e");
accessPackageResource.setOriginSystem("AadApplication");
LinkedList<AccessPackageResourceAttribute> attributes = new LinkedList<AccessPackageResourceAttribute>();
AccessPackageResourceAttribute accessPackageResourceAttribute = new AccessPackageResourceAttribute();
accessPackageResourceAttribute.setAttributeName("extension_2b676109c7c74ae2b41549205f1947ed_personalTitle");
accessPackageResourceAttribute.setIsEditable(true);
accessPackageResourceAttribute.setIsPersistedOnAssignmentRemoval(true);
AccessPackageResourceAttributeQuestion attributeSource = new AccessPackageResourceAttributeQuestion();
attributeSource.setOdataType("#microsoft.graph.accessPackageResourceAttributeQuestion");
AccessPackageTextInputQuestion question = new AccessPackageTextInputQuestion();
question.setOdataType("#microsoft.graph.accessPackageTextInputQuestion");
question.setIsRequired(false);
question.setSequence(0);
question.setIsSingleLineQuestion(true);
AccessPackageLocalizedContent text = new AccessPackageLocalizedContent();
text.setDefaultText("Title");
LinkedList<AccessPackageLocalizedText> localizedTexts = new LinkedList<AccessPackageLocalizedText>();
text.setLocalizedTexts(localizedTexts);
question.setText(text);
attributeSource.setQuestion(question);
accessPackageResourceAttribute.setAttributeSource(attributeSource);
AccessPackageUserDirectoryAttributeStore attributeDestination = new AccessPackageUserDirectoryAttributeStore();
attributeDestination.setOdataType("#microsoft.graph.accessPackageUserDirectoryAttributeStore");
accessPackageResourceAttribute.setAttributeDestination(attributeDestination);
attributes.add(accessPackageResourceAttribute);
accessPackageResource.setAttributes(attributes);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceAttribute;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceAttributeQuestion;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageTextInputQuestion;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageLocalizedContent;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageLocalizedText;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageUserDirectoryAttributeStore;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('26ac0c0a-08bc-4a7b-a313-839f58044ba5');
$requestBody->setRequestType('AdminAdd');
$requestBody->setJustification('');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setDisplayName('Faculty cafeteria ordering');
$accessPackageResource->setDescription('Example application');
$accessPackageResource->setUrl('https://myapps.microsoft.com/example.com/signin/Faculty%20cafeteria%20ordering/f1e3b407-942d-4934-9a3f-cef1975cb988/');
$accessPackageResource->setResourceType('Application');
$accessPackageResource->setOriginId('2f1099a6-d4fc-4cc9-a0ef-ddd3f1bf0b7e');
$accessPackageResource->setOriginSystem('AadApplication');
$attributesAccessPackageResourceAttribute1 = new AccessPackageResourceAttribute();
$attributesAccessPackageResourceAttribute1->setAttributeName('extension_2b676109c7c74ae2b41549205f1947ed_personalTitle');
$attributesAccessPackageResourceAttribute1->setIsEditable(true);
$attributesAccessPackageResourceAttribute1->setIsPersistedOnAssignmentRemoval(true);
$attributesAccessPackageResourceAttribute1AttributeSource = new AccessPackageResourceAttributeQuestion();
$attributesAccessPackageResourceAttribute1AttributeSource->setOdataType('#microsoft.graph.accessPackageResourceAttributeQuestion');
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion = new AccessPackageTextInputQuestion();
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion->setOdataType('#microsoft.graph.accessPackageTextInputQuestion');
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion->setIsRequired(false);
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion->setSequence(0);
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion->setIsSingleLineQuestion(true);
$attributesAccessPackageResourceAttribute1AttributeSourceQuestionText = new AccessPackageLocalizedContent();
$attributesAccessPackageResourceAttribute1AttributeSourceQuestionText->setDefaultText('Title');
$attributesAccessPackageResourceAttribute1AttributeSourceQuestionText->setLocalizedTexts([ ]);
$attributesAccessPackageResourceAttribute1AttributeSourceQuestion->setText($attributesAccessPackageResourceAttribute1AttributeSourceQuestionText);
$attributesAccessPackageResourceAttribute1AttributeSource->setQuestion($attributesAccessPackageResourceAttribute1AttributeSourceQuestion);
$attributesAccessPackageResourceAttribute1->setAttributeSource($attributesAccessPackageResourceAttribute1AttributeSource);
$attributesAccessPackageResourceAttribute1AttributeDestination = new AccessPackageUserDirectoryAttributeStore();
$attributesAccessPackageResourceAttribute1AttributeDestination->setOdataType('#microsoft.graph.accessPackageUserDirectoryAttributeStore');
$attributesAccessPackageResourceAttribute1->setAttributeDestination($attributesAccessPackageResourceAttribute1AttributeDestination);
$attributesArray []= $attributesAccessPackageResourceAttribute1;
$accessPackageResource->setAttributes($attributesArray);
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
from msgraph_beta.generated.models.access_package_resource_attribute import AccessPackageResourceAttribute
from msgraph_beta.generated.models.access_package_resource_attribute_question import AccessPackageResourceAttributeQuestion
from msgraph_beta.generated.models.access_package_text_input_question import AccessPackageTextInputQuestion
from msgraph_beta.generated.models.access_package_localized_content import AccessPackageLocalizedContent
from msgraph_beta.generated.models.access_package_localized_text import AccessPackageLocalizedText
from msgraph_beta.generated.models.access_package_user_directory_attribute_store import AccessPackageUserDirectoryAttributeStore
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
request_type = "AdminAdd",
justification = "",
access_package_resource = AccessPackageResource(
display_name = "Faculty cafeteria ordering",
description = "Example application",
url = "https://myapps.microsoft.com/example.com/signin/Faculty%20cafeteria%20ordering/f1e3b407-942d-4934-9a3f-cef1975cb988/",
resource_type = "Application",
origin_id = "2f1099a6-d4fc-4cc9-a0ef-ddd3f1bf0b7e",
origin_system = "AadApplication",
attributes = [
AccessPackageResourceAttribute(
attribute_name = "extension_2b676109c7c74ae2b41549205f1947ed_personalTitle",
is_editable = True,
is_persisted_on_assignment_removal = True,
attribute_source = AccessPackageResourceAttributeQuestion(
odata_type = "#microsoft.graph.accessPackageResourceAttributeQuestion",
question = AccessPackageTextInputQuestion(
odata_type = "#microsoft.graph.accessPackageTextInputQuestion",
is_required = False,
sequence = 0,
is_single_line_question = True,
text = AccessPackageLocalizedContent(
default_text = "Title",
localized_texts = [
],
),
),
),
attribute_destination = AccessPackageUserDirectoryAttributeStore(
odata_type = "#microsoft.graph.accessPackageUserDirectoryAttributeStore",
),
),
],
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.