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.
Bestimmen Sie, ob eine angegebene Microsoft Teams-Interaktion zwischen dem angemeldeten Benutzer und den angegebenen Benutzern zulässig ist.
Hinweis: Alle Anforderungen an diese API werden in den Microsoft 365-Überwachungsprotokollen der Mandanten protokolliert, in denen die durch den Users-Parameter angegebenen Zielbenutzer vorhanden sind. Weitere Informationen finden Sie unter Überwachungsprotokollaktivitäten.
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) |
TeamworkUserInteraction.Read.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Nicht unterstützt |
Nicht unterstützt |
HTTP-Anforderung
POST /teamwork/determineIfInteractionIsAllowed
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung der Parameter an.
Die folgende Tabelle zeigt die Parameter, die Sie mit dieser Aktion verwenden können.
Antwort
Bei erfolgreicher Ausführung gibt diese Aktion einen 200 OK Antwortcode und einen booleschen Wert im Antworttext zurück.
Beispiele
Beispiel 1: Ermitteln, ob der angemeldete Benutzer mithilfe seiner ID einen Chat mit einem anderen Benutzer im selben Mandanten erstellen kann
Das folgende Beispiel zeigt eine Anforderung, die bestimmt, ob der angemeldete Benutzer, der über delegierten Kontext authentifiziert ist, einen Chat mit einem anderen Benutzer im selben Mandanten erstellen kann, indem er die ID des anderen Benutzers angibt.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/teamwork/determineIfInteractionIsAllowed
{
"users":
[
{
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"id": "59b5bc69-ca73-4ffd-a2e0-88a79115d13b"
}
],
"interactionType": "createChat"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.DetermineIfInteractionIsAllowed;
using Microsoft.Graph.Beta.Models;
var requestBody = new DetermineIfInteractionIsAllowedPostRequestBody
{
Users = new List<Identity>
{
new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
Id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b",
},
},
InteractionType = TeamworkInteractionType.CreateChat,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.DetermineIfInteractionIsAllowed.PostAsDetermineIfInteractionIsAllowedPostResponseAsync(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"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewDetermineIfInteractionIsAllowedPostRequestBody()
identity := graphmodels.NewTeamworkUserIdentity()
id := "59b5bc69-ca73-4ffd-a2e0-88a79115d13b"
identity.SetId(&id)
users := []graphmodels.Identityable {
identity,
}
requestBody.SetUsers(users)
interactionType := graphmodels.CREATECHAT_TEAMWORKINTERACTIONTYPE
requestBody.SetInteractionType(&interactionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
determineIfInteractionIsAllowed, err := graphClient.Teamwork().DetermineIfInteractionIsAllowed().PostAsDetermineIfInteractionIsAllowedPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody determineIfInteractionIsAllowedPostRequestBody = new com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody();
LinkedList<Identity> users = new LinkedList<Identity>();
TeamworkUserIdentity identity = new TeamworkUserIdentity();
identity.setOdataType("microsoft.graph.teamworkUserIdentity");
identity.setId("59b5bc69-ca73-4ffd-a2e0-88a79115d13b");
users.add(identity);
determineIfInteractionIsAllowedPostRequestBody.setUsers(users);
determineIfInteractionIsAllowedPostRequestBody.setInteractionType(TeamworkInteractionType.CreateChat);
var result = graphClient.teamwork().determineIfInteractionIsAllowed().post(determineIfInteractionIsAllowedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
users:
[
{
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
id: '59b5bc69-ca73-4ffd-a2e0-88a79115d13b'
}
],
interactionType: 'createChat'
};
await client.api('/teamwork/determineIfInteractionIsAllowed')
.version('beta')
.post(_boolean);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\DetermineIfInteractionIsAllowed\DetermineIfInteractionIsAllowedPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkUserIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkInteractionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DetermineIfInteractionIsAllowedPostRequestBody();
$usersIdentity1 = new TeamworkUserIdentity();
$usersIdentity1->setOdataType('microsoft.graph.teamworkUserIdentity');
$usersIdentity1->setId('59b5bc69-ca73-4ffd-a2e0-88a79115d13b');
$usersArray []= $usersIdentity1;
$requestBody->setUsers($usersArray);
$requestBody->setInteractionType(new TeamworkInteractionType('createChat'));
$result = $graphServiceClient->teamwork()->determineIfInteractionIsAllowed()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.determine_if_interaction_is_allowed.determine_if_interaction_is_allowed_post_request_body import DetermineIfInteractionIsAllowedPostRequestBody
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.teamwork_user_identity import TeamworkUserIdentity
from msgraph_beta.generated.models.teamwork_interaction_type import TeamworkInteractionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetermineIfInteractionIsAllowedPostRequestBody(
users = [
TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b",
),
],
interaction_type = TeamworkInteractionType.CreateChat,
)
result = await graph_client.teamwork.determine_if_interaction_is_allowed.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 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
Beispiel 2: Ermitteln, ob der angemeldete Benutzer mithilfe seiner ID und Mandanten-ID einen Chat mit einem anderen Benutzer in einem anderen Mandanten erstellen kann
Das folgende Beispiel zeigt eine Anforderung, die bestimmt, ob der angemeldete Benutzer, der über delegierten Kontext authentifiziert ist, einen Chat mit einem anderen Benutzer in einem anderen Mandanten erstellen kann, indem die ID und mandanten-ID des anderen Benutzers verwendet wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/teamwork/determineIfInteractionIsAllowed
{
"users":
[
{
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"id": "59b5bc69-ca73-4ffd-a2e0-88a79115d13b",
"tenantId": "b11186db-6149-4b3d-95ad-23c9e1bf6853"
}
],
"interactionType": "createChat"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.DetermineIfInteractionIsAllowed;
using Microsoft.Graph.Beta.Models;
var requestBody = new DetermineIfInteractionIsAllowedPostRequestBody
{
Users = new List<Identity>
{
new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
Id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "b11186db-6149-4b3d-95ad-23c9e1bf6853"
},
},
},
},
InteractionType = TeamworkInteractionType.CreateChat,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.DetermineIfInteractionIsAllowed.PostAsDetermineIfInteractionIsAllowedPostResponseAsync(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"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewDetermineIfInteractionIsAllowedPostRequestBody()
identity := graphmodels.NewTeamworkUserIdentity()
id := "59b5bc69-ca73-4ffd-a2e0-88a79115d13b"
identity.SetId(&id)
additionalData := map[string]interface{}{
"tenantId" : "b11186db-6149-4b3d-95ad-23c9e1bf6853",
}
identity.SetAdditionalData(additionalData)
users := []graphmodels.Identityable {
identity,
}
requestBody.SetUsers(users)
interactionType := graphmodels.CREATECHAT_TEAMWORKINTERACTIONTYPE
requestBody.SetInteractionType(&interactionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
determineIfInteractionIsAllowed, err := graphClient.Teamwork().DetermineIfInteractionIsAllowed().PostAsDetermineIfInteractionIsAllowedPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody determineIfInteractionIsAllowedPostRequestBody = new com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody();
LinkedList<Identity> users = new LinkedList<Identity>();
TeamworkUserIdentity identity = new TeamworkUserIdentity();
identity.setOdataType("microsoft.graph.teamworkUserIdentity");
identity.setId("59b5bc69-ca73-4ffd-a2e0-88a79115d13b");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "b11186db-6149-4b3d-95ad-23c9e1bf6853");
identity.setAdditionalData(additionalData);
users.add(identity);
determineIfInteractionIsAllowedPostRequestBody.setUsers(users);
determineIfInteractionIsAllowedPostRequestBody.setInteractionType(TeamworkInteractionType.CreateChat);
var result = graphClient.teamwork().determineIfInteractionIsAllowed().post(determineIfInteractionIsAllowedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
users:
[
{
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
id: '59b5bc69-ca73-4ffd-a2e0-88a79115d13b',
tenantId: 'b11186db-6149-4b3d-95ad-23c9e1bf6853'
}
],
interactionType: 'createChat'
};
await client.api('/teamwork/determineIfInteractionIsAllowed')
.version('beta')
.post(_boolean);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\DetermineIfInteractionIsAllowed\DetermineIfInteractionIsAllowedPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkUserIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkInteractionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DetermineIfInteractionIsAllowedPostRequestBody();
$usersIdentity1 = new TeamworkUserIdentity();
$usersIdentity1->setOdataType('microsoft.graph.teamworkUserIdentity');
$usersIdentity1->setId('59b5bc69-ca73-4ffd-a2e0-88a79115d13b');
$additionalData = [
'tenantId' => 'b11186db-6149-4b3d-95ad-23c9e1bf6853',
];
$usersIdentity1->setAdditionalData($additionalData);
$usersArray []= $usersIdentity1;
$requestBody->setUsers($usersArray);
$requestBody->setInteractionType(new TeamworkInteractionType('createChat'));
$result = $graphServiceClient->teamwork()->determineIfInteractionIsAllowed()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b"
tenantId = "b11186db-6149-4b3d-95ad-23c9e1bf6853"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.determine_if_interaction_is_allowed.determine_if_interaction_is_allowed_post_request_body import DetermineIfInteractionIsAllowedPostRequestBody
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.teamwork_user_identity import TeamworkUserIdentity
from msgraph_beta.generated.models.teamwork_interaction_type import TeamworkInteractionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetermineIfInteractionIsAllowedPostRequestBody(
users = [
TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
id = "59b5bc69-ca73-4ffd-a2e0-88a79115d13b",
additional_data = {
"tenant_id" : "b11186db-6149-4b3d-95ad-23c9e1bf6853",
}
),
],
interaction_type = TeamworkInteractionType.CreateChat,
)
result = await graph_client.teamwork.determine_if_interaction_is_allowed.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 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
Beispiel 3: Ermitteln, ob der angemeldete Benutzer mithilfe seines Benutzerprinzipalnamens einen Chat mit einem anderen Benutzer erstellen kann
Das folgende Beispiel zeigt eine Anforderung, die bestimmt, ob der angemeldete Benutzer, der über delegierten Kontext authentifiziert ist, einen Chat mit einem anderen Benutzer erstellen kann, indem er den Benutzerprinzipalnamen des anderen Benutzers angibt. Wenn Sie den Benutzerprinzipalnamen eines Benutzers in einem anderen Mandanten angeben, muss tenantId nicht angegeben werden.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/teamwork/determineIfInteractionIsAllowed
{
"users":
[
{
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"userPrincipalName": "maia@contoso.com"
}
],
"interactionType": "createChat"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.DetermineIfInteractionIsAllowed;
using Microsoft.Graph.Beta.Models;
var requestBody = new DetermineIfInteractionIsAllowedPostRequestBody
{
Users = new List<Identity>
{
new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
UserPrincipalName = "maia@contoso.com",
},
},
InteractionType = TeamworkInteractionType.CreateChat,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.DetermineIfInteractionIsAllowed.PostAsDetermineIfInteractionIsAllowedPostResponseAsync(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"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewDetermineIfInteractionIsAllowedPostRequestBody()
identity := graphmodels.NewTeamworkUserIdentity()
userPrincipalName := "maia@contoso.com"
identity.SetUserPrincipalName(&userPrincipalName)
users := []graphmodels.Identityable {
identity,
}
requestBody.SetUsers(users)
interactionType := graphmodels.CREATECHAT_TEAMWORKINTERACTIONTYPE
requestBody.SetInteractionType(&interactionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
determineIfInteractionIsAllowed, err := graphClient.Teamwork().DetermineIfInteractionIsAllowed().PostAsDetermineIfInteractionIsAllowedPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody determineIfInteractionIsAllowedPostRequestBody = new com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody();
LinkedList<Identity> users = new LinkedList<Identity>();
TeamworkUserIdentity identity = new TeamworkUserIdentity();
identity.setOdataType("microsoft.graph.teamworkUserIdentity");
identity.setUserPrincipalName("maia@contoso.com");
users.add(identity);
determineIfInteractionIsAllowedPostRequestBody.setUsers(users);
determineIfInteractionIsAllowedPostRequestBody.setInteractionType(TeamworkInteractionType.CreateChat);
var result = graphClient.teamwork().determineIfInteractionIsAllowed().post(determineIfInteractionIsAllowedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
users:
[
{
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
userPrincipalName: 'maia@contoso.com'
}
],
interactionType: 'createChat'
};
await client.api('/teamwork/determineIfInteractionIsAllowed')
.version('beta')
.post(_boolean);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\DetermineIfInteractionIsAllowed\DetermineIfInteractionIsAllowedPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkUserIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkInteractionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DetermineIfInteractionIsAllowedPostRequestBody();
$usersIdentity1 = new TeamworkUserIdentity();
$usersIdentity1->setOdataType('microsoft.graph.teamworkUserIdentity');
$usersIdentity1->setUserPrincipalName('maia@contoso.com');
$usersArray []= $usersIdentity1;
$requestBody->setUsers($usersArray);
$requestBody->setInteractionType(new TeamworkInteractionType('createChat'));
$result = $graphServiceClient->teamwork()->determineIfInteractionIsAllowed()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
userPrincipalName = "maia@contoso.com"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.determine_if_interaction_is_allowed.determine_if_interaction_is_allowed_post_request_body import DetermineIfInteractionIsAllowedPostRequestBody
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.teamwork_user_identity import TeamworkUserIdentity
from msgraph_beta.generated.models.teamwork_interaction_type import TeamworkInteractionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetermineIfInteractionIsAllowedPostRequestBody(
users = [
TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
user_principal_name = "maia@contoso.com",
),
],
interaction_type = TeamworkInteractionType.CreateChat,
)
result = await graph_client.teamwork.determine_if_interaction_is_allowed.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 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
Beispiel 4: Ermitteln, ob der angemeldete Benutzer mithilfe seiner E-Mail-Adresse einen Chat mit einem anderen Benutzer erstellen kann
Das folgende Beispiel zeigt eine Anforderung, die bestimmt, ob der angemeldete Benutzer, der über delegierten Kontext authentifiziert ist, einen Chat mit einem anderen Benutzer erstellen kann, indem er die E-Mail-Adresse des anderen Benutzers angibt.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/teamwork/determineIfInteractionIsAllowed
{
"users":
[
{
"@odata.type": "microsoft.graph.emailIdentity",
"email": "LauraW@contoso.com"
}
],
"interactionType": "createChat"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.DetermineIfInteractionIsAllowed;
using Microsoft.Graph.Beta.Models;
var requestBody = new DetermineIfInteractionIsAllowedPostRequestBody
{
Users = new List<Identity>
{
new EmailIdentity
{
OdataType = "microsoft.graph.emailIdentity",
Email = "LauraW@contoso.com",
},
},
InteractionType = TeamworkInteractionType.CreateChat,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.DetermineIfInteractionIsAllowed.PostAsDetermineIfInteractionIsAllowedPostResponseAsync(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"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewDetermineIfInteractionIsAllowedPostRequestBody()
identity := graphmodels.NewEmailIdentity()
email := "LauraW@contoso.com"
identity.SetEmail(&email)
users := []graphmodels.Identityable {
identity,
}
requestBody.SetUsers(users)
interactionType := graphmodels.CREATECHAT_TEAMWORKINTERACTIONTYPE
requestBody.SetInteractionType(&interactionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
determineIfInteractionIsAllowed, err := graphClient.Teamwork().DetermineIfInteractionIsAllowed().PostAsDetermineIfInteractionIsAllowedPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody determineIfInteractionIsAllowedPostRequestBody = new com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody();
LinkedList<Identity> users = new LinkedList<Identity>();
EmailIdentity identity = new EmailIdentity();
identity.setOdataType("microsoft.graph.emailIdentity");
identity.setEmail("LauraW@contoso.com");
users.add(identity);
determineIfInteractionIsAllowedPostRequestBody.setUsers(users);
determineIfInteractionIsAllowedPostRequestBody.setInteractionType(TeamworkInteractionType.CreateChat);
var result = graphClient.teamwork().determineIfInteractionIsAllowed().post(determineIfInteractionIsAllowedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
users:
[
{
'@odata.type': 'microsoft.graph.emailIdentity',
email: 'LauraW@contoso.com'
}
],
interactionType: 'createChat'
};
await client.api('/teamwork/determineIfInteractionIsAllowed')
.version('beta')
.post(_boolean);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\DetermineIfInteractionIsAllowed\DetermineIfInteractionIsAllowedPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\EmailIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkInteractionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DetermineIfInteractionIsAllowedPostRequestBody();
$usersIdentity1 = new EmailIdentity();
$usersIdentity1->setOdataType('microsoft.graph.emailIdentity');
$usersIdentity1->setEmail('LauraW@contoso.com');
$usersArray []= $usersIdentity1;
$requestBody->setUsers($usersArray);
$requestBody->setInteractionType(new TeamworkInteractionType('createChat'));
$result = $graphServiceClient->teamwork()->determineIfInteractionIsAllowed()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.emailIdentity"
email = "LauraW@contoso.com"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.determine_if_interaction_is_allowed.determine_if_interaction_is_allowed_post_request_body import DetermineIfInteractionIsAllowedPostRequestBody
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.email_identity import EmailIdentity
from msgraph_beta.generated.models.teamwork_interaction_type import TeamworkInteractionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetermineIfInteractionIsAllowedPostRequestBody(
users = [
EmailIdentity(
odata_type = "microsoft.graph.emailIdentity",
email = "LauraW@contoso.com",
),
],
interaction_type = TeamworkInteractionType.CreateChat,
)
result = await graph_client.teamwork.determine_if_interaction_is_allowed.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 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
Beispiel 5: Ermitteln, ob der angemeldete Benutzer einen Chat mit drei anderen Benutzern erstellen kann
Das folgende Beispiel zeigt eine Anforderung, die bestimmt, ob der angemeldete Benutzer, der über delegierten Kontext authentifiziert ist, einen Chat mit drei anderen Benutzern erstellen kann. Es wird eine Mischung der unterstützten Identitätstypen verwendet. In diesem Beispiel ist die Interaktion nicht zulässig.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/teamwork/determineIfInteractionIsAllowed
{
"users":
[
{
"@odata.type": "microsoft.graph.emailIdentity",
"email": "LauraW@foo.com"
},
{
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"userPrincipalName": "MaiaR@foobar.com"
},
{
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"id": "bd6a223f-59b5-46dd-90bc-0ddebaf3da5a"
}
],
"interactionType": "createChat"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.DetermineIfInteractionIsAllowed;
using Microsoft.Graph.Beta.Models;
var requestBody = new DetermineIfInteractionIsAllowedPostRequestBody
{
Users = new List<Identity>
{
new EmailIdentity
{
OdataType = "microsoft.graph.emailIdentity",
Email = "LauraW@foo.com",
},
new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
UserPrincipalName = "MaiaR@foobar.com",
},
new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
Id = "bd6a223f-59b5-46dd-90bc-0ddebaf3da5a",
},
},
InteractionType = TeamworkInteractionType.CreateChat,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.DetermineIfInteractionIsAllowed.PostAsDetermineIfInteractionIsAllowedPostResponseAsync(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"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewDetermineIfInteractionIsAllowedPostRequestBody()
identity := graphmodels.NewEmailIdentity()
email := "LauraW@foo.com"
identity.SetEmail(&email)
identity1 := graphmodels.NewTeamworkUserIdentity()
userPrincipalName := "MaiaR@foobar.com"
identity1.SetUserPrincipalName(&userPrincipalName)
identity2 := graphmodels.NewTeamworkUserIdentity()
id := "bd6a223f-59b5-46dd-90bc-0ddebaf3da5a"
identity2.SetId(&id)
users := []graphmodels.Identityable {
identity,
identity1,
identity2,
}
requestBody.SetUsers(users)
interactionType := graphmodels.CREATECHAT_TEAMWORKINTERACTIONTYPE
requestBody.SetInteractionType(&interactionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
determineIfInteractionIsAllowed, err := graphClient.Teamwork().DetermineIfInteractionIsAllowed().PostAsDetermineIfInteractionIsAllowedPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody determineIfInteractionIsAllowedPostRequestBody = new com.microsoft.graph.beta.teamwork.determineifinteractionisallowed.DetermineIfInteractionIsAllowedPostRequestBody();
LinkedList<Identity> users = new LinkedList<Identity>();
EmailIdentity identity = new EmailIdentity();
identity.setOdataType("microsoft.graph.emailIdentity");
identity.setEmail("LauraW@foo.com");
users.add(identity);
TeamworkUserIdentity identity1 = new TeamworkUserIdentity();
identity1.setOdataType("microsoft.graph.teamworkUserIdentity");
identity1.setUserPrincipalName("MaiaR@foobar.com");
users.add(identity1);
TeamworkUserIdentity identity2 = new TeamworkUserIdentity();
identity2.setOdataType("microsoft.graph.teamworkUserIdentity");
identity2.setId("bd6a223f-59b5-46dd-90bc-0ddebaf3da5a");
users.add(identity2);
determineIfInteractionIsAllowedPostRequestBody.setUsers(users);
determineIfInteractionIsAllowedPostRequestBody.setInteractionType(TeamworkInteractionType.CreateChat);
var result = graphClient.teamwork().determineIfInteractionIsAllowed().post(determineIfInteractionIsAllowedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
users:
[
{
'@odata.type': 'microsoft.graph.emailIdentity',
email: 'LauraW@foo.com'
},
{
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
userPrincipalName: 'MaiaR@foobar.com'
},
{
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
id: 'bd6a223f-59b5-46dd-90bc-0ddebaf3da5a'
}
],
interactionType: 'createChat'
};
await client.api('/teamwork/determineIfInteractionIsAllowed')
.version('beta')
.post(_boolean);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\DetermineIfInteractionIsAllowed\DetermineIfInteractionIsAllowedPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\EmailIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkUserIdentity;
use Microsoft\Graph\Beta\Generated\Models\TeamworkInteractionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DetermineIfInteractionIsAllowedPostRequestBody();
$usersIdentity1 = new EmailIdentity();
$usersIdentity1->setOdataType('microsoft.graph.emailIdentity');
$usersIdentity1->setEmail('LauraW@foo.com');
$usersArray []= $usersIdentity1;
$usersIdentity2 = new TeamworkUserIdentity();
$usersIdentity2->setOdataType('microsoft.graph.teamworkUserIdentity');
$usersIdentity2->setUserPrincipalName('MaiaR@foobar.com');
$usersArray []= $usersIdentity2;
$usersIdentity3 = new TeamworkUserIdentity();
$usersIdentity3->setOdataType('microsoft.graph.teamworkUserIdentity');
$usersIdentity3->setId('bd6a223f-59b5-46dd-90bc-0ddebaf3da5a');
$usersArray []= $usersIdentity3;
$requestBody->setUsers($usersArray);
$requestBody->setInteractionType(new TeamworkInteractionType('createChat'));
$result = $graphServiceClient->teamwork()->determineIfInteractionIsAllowed()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.emailIdentity"
email = "LauraW@foo.com"
}
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
userPrincipalName = "MaiaR@foobar.com"
}
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
id = "bd6a223f-59b5-46dd-90bc-0ddebaf3da5a"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.determine_if_interaction_is_allowed.determine_if_interaction_is_allowed_post_request_body import DetermineIfInteractionIsAllowedPostRequestBody
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.email_identity import EmailIdentity
from msgraph_beta.generated.models.teamwork_user_identity import TeamworkUserIdentity
from msgraph_beta.generated.models.teamwork_interaction_type import TeamworkInteractionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetermineIfInteractionIsAllowedPostRequestBody(
users = [
EmailIdentity(
odata_type = "microsoft.graph.emailIdentity",
email = "LauraW@foo.com",
),
TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
user_principal_name = "MaiaR@foobar.com",
),
TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
id = "bd6a223f-59b5-46dd-90bc-0ddebaf3da5a",
),
],
interaction_type = TeamworkInteractionType.CreateChat,
)
result = await graph_client.teamwork.determine_if_interaction_is_allowed.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 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": false
}