Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Erstellen Sie eine neue mandantenübergreifende Microsoft 365-Funktion für einen Partner organization in der mandantenübergreifenden Zugriffsrichtlinie. Die @odata.type-Eigenschaft im Anforderungstext ist erforderlich, um anzugeben, welche Art von Funktion erstellt werden soll.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
Policy.ReadWrite.CrossTenantCapability |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Policy.ReadWrite.CrossTenantCapability |
Nicht verfügbar. |
HTTP-Anforderung
POST /policies/crossTenantAccessPolicy/partners/{crossTenantAccessPolicyConfigurationPartner-id}/m365Capabilities
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des abgeleiteten Typs m365CapabilityBase an. Die @odata.type-Eigenschaft ist erforderlich, um den Funktionstyp anzugeben.
Sie können die folgenden Eigenschaften angeben, wenn Sie eine m365CapabilityBase-Funktion erstellen.
| Eigenschaft |
Typ |
Beschreibung |
| @odata.type |
Zeichenfolge |
Der Typ der zu erstellenden Funktion. Erforderlich. Beispielwerte: #microsoft.graph.crossTenantOpenProfileCard, #microsoft.graph.crossTenantMigration |
| inboundAccess |
m365CapabilityInboundAccess |
Die Einstellungen für eingehenden Zugriff für die Funktion. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und das erstellte Funktionsobjekt im Antworttext zurück.
Beispiele
Beispiel 1: Erstellen einer mandantenübergreifenden E-Mail-Tipps-Funktion
Das folgende Beispiel zeigt, wie Sie eine mandantenübergreifende E-Mail-Tipps-Funktion erstellen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/partners/af7b70b0-d161-4628-82b4-16190344c029/m365Capabilities
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantMailTipsLimited",
"inboundAccess": {
"isAllowed": false,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CrossTenantMailTipsLimited
{
OdataType = "#microsoft.graph.crossTenantMailTipsLimited",
InboundAccess = new M365CapabilityInboundAccess
{
IsAllowed = false,
ResourceScopes = new M365CapabilityResourceScopes
{
Included = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
ResourceType = M365ResourceType.Group,
},
},
Excluded = new List<M365CapabilityResourceScope>
{
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.CrossTenantAccessPolicy.Partners["{crossTenantAccessPolicyConfigurationPartner-tenantId}"].M365Capabilities.PostAsync(requestBody);
// 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.NewM365CapabilityBase()
inboundAccess := graphmodels.NewM365CapabilityInboundAccess()
isAllowed := false
inboundAccess.SetIsAllowed(&isAllowed)
resourceScopes := graphmodels.NewM365CapabilityResourceScopes()
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
included := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
}
resourceScopes.SetIncluded(included)
excluded := []graphmodels.M365CapabilityResourceScopeable {
}
resourceScopes.SetExcluded(excluded)
inboundAccess.SetResourceScopes(resourceScopes)
requestBody.SetInboundAccess(inboundAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
m365Capabilities, err := graphClient.Policies().CrossTenantAccessPolicy().Partners().ByCrossTenantAccessPolicyConfigurationPartnerTenantId("crossTenantAccessPolicyConfigurationPartner-tenantId").M365Capabilities().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CrossTenantMailTipsLimited m365CapabilityBase = new CrossTenantMailTipsLimited();
m365CapabilityBase.setOdataType("#microsoft.graph.crossTenantMailTipsLimited");
M365CapabilityInboundAccess inboundAccess = new M365CapabilityInboundAccess();
inboundAccess.setIsAllowed(false);
M365CapabilityResourceScopes resourceScopes = new M365CapabilityResourceScopes();
LinkedList<M365CapabilityResourceScope> included = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope = new M365CapabilityResourceScope();
m365CapabilityResourceScope.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e74");
m365CapabilityResourceScope.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope);
resourceScopes.setIncluded(included);
LinkedList<M365CapabilityResourceScope> excluded = new LinkedList<M365CapabilityResourceScope>();
resourceScopes.setExcluded(excluded);
inboundAccess.setResourceScopes(resourceScopes);
m365CapabilityBase.setInboundAccess(inboundAccess);
M365CapabilityBase result = graphClient.policies().crossTenantAccessPolicy().partners().byCrossTenantAccessPolicyConfigurationPartnerTenantId("{crossTenantAccessPolicyConfigurationPartner-tenantId}").m365Capabilities().post(m365CapabilityBase);
const options = {
authProvider,
};
const client = Client.init(options);
const m365CapabilityBase = {
'@odata.type': '#microsoft.graph.crossTenantMailTipsLimited',
inboundAccess: {
isAllowed: false,
resourceScopes: {
included: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e74',
resourceType: 'group'
}
],
excluded: []
}
}
};
await client.api('/policies/crossTenantAccessPolicy/partners/af7b70b0-d161-4628-82b4-16190344c029/m365Capabilities')
.version('beta')
.post(m365CapabilityBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CrossTenantMailTipsLimited;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityInboundAccess;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScopes;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScope;
use Microsoft\Graph\Beta\Generated\Models\M365ResourceType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CrossTenantMailTipsLimited();
$requestBody->setOdataType('#microsoft.graph.crossTenantMailTipsLimited');
$inboundAccess = new M365CapabilityInboundAccess();
$inboundAccess->setIsAllowed(false);
$inboundAccessResourceScopes = new M365CapabilityResourceScopes();
$includedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e74');
$includedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope1;
$inboundAccessResourceScopes->setIncluded($includedArray);
$inboundAccessResourceScopes->setExcluded([]);
$inboundAccess->setResourceScopes($inboundAccessResourceScopes);
$requestBody->setInboundAccess($inboundAccess);
$result = $graphServiceClient->policies()->crossTenantAccessPolicy()->partners()->byCrossTenantAccessPolicyConfigurationPartnerTenantId('crossTenantAccessPolicyConfigurationPartner-tenantId')->m365Capabilities()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.cross_tenant_mail_tips_limited import CrossTenantMailTipsLimited
from msgraph_beta.generated.models.m365_capability_inbound_access import M365CapabilityInboundAccess
from msgraph_beta.generated.models.m365_capability_resource_scopes import M365CapabilityResourceScopes
from msgraph_beta.generated.models.m365_capability_resource_scope import M365CapabilityResourceScope
from msgraph_beta.generated.models.m365_resource_type import M365ResourceType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CrossTenantMailTipsLimited(
odata_type = "#microsoft.graph.crossTenantMailTipsLimited",
inbound_access = M365CapabilityInboundAccess(
is_allowed = False,
resource_scopes = M365CapabilityResourceScopes(
included = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
resource_type = M365ResourceType.Group,
),
],
excluded = [
],
),
),
)
result = await graph_client.policies.cross_tenant_access_policy.partners.by_cross_tenant_access_policy_configuration_partner_tenant_id('crossTenantAccessPolicyConfigurationPartner-tenantId').m365_capabilities.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantMailTipsLimited",
"name": "crossTenantMailTipsLimited",
"lastModifiedDateTime": "2026-01-15T09:57:58.6364196Z",
"inboundAccess": {
"isAllowed": false,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}
Beispiel 2: Erstellen einer mandantenübergreifenden Platzbuchungsfunktion
Im folgenden Beispiel wird gezeigt, wie Sie eine mandantenübergreifende Raumbuchungsfunktion erstellen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/partners/af7b70b0-d161-4628-82b4-16190344c029/m365Capabilities
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantPlacesRoomBooking",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CrossTenantPlacesRoomBooking
{
OdataType = "#microsoft.graph.crossTenantPlacesRoomBooking",
InboundAccess = new M365CapabilityInboundAccess
{
IsAllowed = true,
ResourceScopes = new M365CapabilityResourceScopes
{
Included = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
ResourceType = M365ResourceType.Group,
},
},
Excluded = new List<M365CapabilityResourceScope>
{
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.CrossTenantAccessPolicy.Partners["{crossTenantAccessPolicyConfigurationPartner-tenantId}"].M365Capabilities.PostAsync(requestBody);
// 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.NewM365CapabilityBase()
inboundAccess := graphmodels.NewM365CapabilityInboundAccess()
isAllowed := true
inboundAccess.SetIsAllowed(&isAllowed)
resourceScopes := graphmodels.NewM365CapabilityResourceScopes()
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
included := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
}
resourceScopes.SetIncluded(included)
excluded := []graphmodels.M365CapabilityResourceScopeable {
}
resourceScopes.SetExcluded(excluded)
inboundAccess.SetResourceScopes(resourceScopes)
requestBody.SetInboundAccess(inboundAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
m365Capabilities, err := graphClient.Policies().CrossTenantAccessPolicy().Partners().ByCrossTenantAccessPolicyConfigurationPartnerTenantId("crossTenantAccessPolicyConfigurationPartner-tenantId").M365Capabilities().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CrossTenantPlacesRoomBooking m365CapabilityBase = new CrossTenantPlacesRoomBooking();
m365CapabilityBase.setOdataType("#microsoft.graph.crossTenantPlacesRoomBooking");
M365CapabilityInboundAccess inboundAccess = new M365CapabilityInboundAccess();
inboundAccess.setIsAllowed(true);
M365CapabilityResourceScopes resourceScopes = new M365CapabilityResourceScopes();
LinkedList<M365CapabilityResourceScope> included = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope = new M365CapabilityResourceScope();
m365CapabilityResourceScope.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e74");
m365CapabilityResourceScope.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope);
resourceScopes.setIncluded(included);
LinkedList<M365CapabilityResourceScope> excluded = new LinkedList<M365CapabilityResourceScope>();
resourceScopes.setExcluded(excluded);
inboundAccess.setResourceScopes(resourceScopes);
m365CapabilityBase.setInboundAccess(inboundAccess);
M365CapabilityBase result = graphClient.policies().crossTenantAccessPolicy().partners().byCrossTenantAccessPolicyConfigurationPartnerTenantId("{crossTenantAccessPolicyConfigurationPartner-tenantId}").m365Capabilities().post(m365CapabilityBase);
const options = {
authProvider,
};
const client = Client.init(options);
const m365CapabilityBase = {
'@odata.type': '#microsoft.graph.crossTenantPlacesRoomBooking',
inboundAccess: {
isAllowed: true,
resourceScopes: {
included: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e74',
resourceType: 'group'
}
],
excluded: []
}
}
};
await client.api('/policies/crossTenantAccessPolicy/partners/af7b70b0-d161-4628-82b4-16190344c029/m365Capabilities')
.version('beta')
.post(m365CapabilityBase);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CrossTenantPlacesRoomBooking;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityInboundAccess;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScopes;
use Microsoft\Graph\Beta\Generated\Models\M365CapabilityResourceScope;
use Microsoft\Graph\Beta\Generated\Models\M365ResourceType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CrossTenantPlacesRoomBooking();
$requestBody->setOdataType('#microsoft.graph.crossTenantPlacesRoomBooking');
$inboundAccess = new M365CapabilityInboundAccess();
$inboundAccess->setIsAllowed(true);
$inboundAccessResourceScopes = new M365CapabilityResourceScopes();
$includedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e74');
$includedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope1;
$inboundAccessResourceScopes->setIncluded($includedArray);
$inboundAccessResourceScopes->setExcluded([]);
$inboundAccess->setResourceScopes($inboundAccessResourceScopes);
$requestBody->setInboundAccess($inboundAccess);
$result = $graphServiceClient->policies()->crossTenantAccessPolicy()->partners()->byCrossTenantAccessPolicyConfigurationPartnerTenantId('crossTenantAccessPolicyConfigurationPartner-tenantId')->m365Capabilities()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.cross_tenant_places_room_booking import CrossTenantPlacesRoomBooking
from msgraph_beta.generated.models.m365_capability_inbound_access import M365CapabilityInboundAccess
from msgraph_beta.generated.models.m365_capability_resource_scopes import M365CapabilityResourceScopes
from msgraph_beta.generated.models.m365_capability_resource_scope import M365CapabilityResourceScope
from msgraph_beta.generated.models.m365_resource_type import M365ResourceType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CrossTenantPlacesRoomBooking(
odata_type = "#microsoft.graph.crossTenantPlacesRoomBooking",
inbound_access = M365CapabilityInboundAccess(
is_allowed = True,
resource_scopes = M365CapabilityResourceScopes(
included = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
resource_type = M365ResourceType.Group,
),
],
excluded = [
],
),
),
)
result = await graph_client.policies.cross_tenant_access_policy.partners.by_cross_tenant_access_policy_configuration_partner_tenant_id('crossTenantAccessPolicyConfigurationPartner-tenantId').m365_capabilities.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.crossTenantPlacesRoomBooking",
"name": "crossTenantPlacesRoomBooking",
"lastModifiedDateTime": "2026-01-15T10:27:34.8241493Z",
"inboundAccess": {
"isAllowed": true,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
}
],
"excluded": []
}
}
}