命名空间:microsoft.graph
重要
Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
确定是否允许在已登录用户和指定用户之间进行指定的Microsoft Teams 交互。
注意:对此 API 的所有请求都记录在Microsoft 365 审核日志中,这些租户中存在 由 users 参数指定的目标用户。 有关详细信息,请参阅 审核日志活动。
此 API 可用于以下国家级云部署。
| 全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 | 最低特权权限 | 更高特权权限 |
|---|---|---|
| 委派(工作或学校帐户) | TeamworkUserInteraction.Read.All | 不可用。 |
| 委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
| 应用程序 | 不支持。 | 不支持。 |
HTTP 请求
POST /teamwork/determineIfInteractionIsAllowed
请求标头
| 名称 | 说明 |
|---|---|
| Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type | application/json. 必需。 |
请求正文
在请求正文中,提供参数的 JSON 表示形式。
下表显示了可用于此作的参数。
| 参数 | 类型 | 说明 |
|---|---|---|
| interactionType | teamworkInteractionType | Microsoft Teams 上的交互类型。 |
| users | identity 集合 | 调用方希望确定是否允许交互的目标用户的集合。 支持的派生类型是 emailIdentity 和 teamworkUserIdentity。 |
响应
如果成功,此作将在 200 OK 响应正文中返回响应代码和布尔值。
示例
示例 1:确定已登录用户是否可以使用其 ID 与同一租户中的其他用户创建聊天
以下示例演示一个请求,该请求确定通过委托上下文进行身份验证的已登录用户是否可以通过指定其他用户的 ID 与同一租户中的其他用户创建聊天。
请求
以下示例显示了一个请求。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?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();
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
示例 2:确定已登录用户是否可以使用其 ID 和租户 ID 与其他租户中的其他用户创建聊天
以下示例显示了一个请求,该请求确定通过委托上下文进行身份验证的已登录用户是否可以使用其他用户的 ID 和租户 ID 与其他租户中的其他用户创建聊天。
请求
以下示例显示了一个请求。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?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();
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
示例 3:确定已登录用户是否可以使用其他用户的用户主体名称创建聊天
以下示例演示一个请求,该请求确定通过委托上下文进行身份验证的已登录用户是否可以通过指定其他用户的用户主体名称创建与其他用户的聊天。 指定另一租户中某个用户的用户主体名称时,无需指定 tenantId 。
请求
以下示例显示了一个请求。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?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();
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
userPrincipalName = "maia@contoso.com"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
示例 4:确定已登录用户是否可以使用其电子邮件与其他用户创建聊天
以下示例显示了一个请求,该请求确定通过委托上下文进行身份验证的已登录用户是否可以通过指定其他用户的电子邮件创建与其他用户的聊天。
请求
以下示例显示了一个请求。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?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();
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
users = @(
@{
"@odata.type" = "microsoft.graph.emailIdentity"
email = "LauraW@contoso.com"
}
)
interactionType = "createChat"
}
Invoke-MgBetaDetermineTeamworkIfInteractionIsAllowed -BodyParameter $params
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}
示例 5:确定已登录用户是否可以与其他三个用户创建聊天
以下示例显示了一个请求,该请求确定通过委托上下文进行身份验证的已登录用户是否可以与其他三个用户创建聊天。 它混合使用支持的 标识 类型。 在此示例中,不允许交互。
请求
以下示例显示了一个请求。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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);
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?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();
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
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
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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)
重要
Microsoft Graph SDK 默认使用 v1.0 版本的 API,并且不支持 beta 版本中提供的所有类型、属性和 API。 有关使用 SDK 访问 beta API 的详细信息,请参阅将 Microsoft Graph SDK 与 beta API 配合使用。
有关如何将 SDK 添加到项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": false
}
反馈
此页面是否有帮助?
否
需要有关本主题的帮助?
想要尝试使用 Ask Learn 阐明或指导你完成本主题?
其他资源
-
Last updated on
2025-06-14