Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
Tipo de permissão
Permissões com menos privilégios
Permissões com privilégios superiores
Delegado (conta corporativa ou de estudante)
TeamMember.ReadWrite.All
Indisponível.
Delegado (conta pessoal da Microsoft)
Sem suporte.
Sem suporte.
Aplicativo
TeamMember.ReadWrite.All
Indisponível.
Solicitação HTTP
Esta API é uma ação vinculada para remover vários elementos de uma coleção conversationMember num único pedido.
No corpo do pedido, forneça a representação JSON da lista de derivados conversationMember a serem removidos de uma equipa. Um máximo de 20 derivados de membro da conversação podem ser removidos num único pedido.
A tabela seguinte mostra o parâmetro que pode utilizar com este método.
Se for bem-sucedido, este método devolve uma 204 No Content resposta se todos os membros especificados forem removidos com êxito da equipa ou uma 207 Multi-Status resposta se apenas alguns membros forem removidos. O autor da chamada deve inspecionar o payload da resposta para identificar que remoção de membros falharam. O corpo da resposta contém uma coleção de derivados do recurso actionResultPart . Se o pedido falhar, a API devolve um erro. Para saber mais sobre erros do Microsoft Graph, confira Respostas de erros e tipos de recurso do Microsoft Graph.
Exemplos
Exemplo 1: Remover membros em massa de uma equipa
O exemplo seguinte mostra como remover vários membros de uma equipa num único pedido.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Members.Remove;
using Microsoft.Graph.Models;
var requestBody = new RemovePostRequestBody
{
Values = new List<ConversationMember>
{
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('18a80140-b0fb-4489-b360-2f6efaf225a0')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
},
},
},
},
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Members.Remove.PostAsRemovePostResponseAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody();
LinkedList<ConversationMember> values = new LinkedList<ConversationMember>();
AadUserConversationMember conversationMember = new AadUserConversationMember();
conversationMember.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('18a80140-b0fb-4489-b360-2f6efaf225a0')");
conversationMember.setAdditionalData(additionalData);
values.add(conversationMember);
AadUserConversationMember conversationMember1 = new AadUserConversationMember();
conversationMember1.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')");
conversationMember1.setAdditionalData(additionalData1);
values.add(conversationMember1);
removePostRequestBody.setValues(values);
var result = graphClient.teams().byTeamId("{team-id}").members().remove().post(removePostRequestBody);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph.generated.models.conversation_member import ConversationMember
from msgraph.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemovePostRequestBody(
values = [
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('18a80140-b0fb-4489-b360-2f6efaf225a0')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')",
}
),
],
)
result = await graph_client.teams.by_team_id('team-id').members.remove.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Members.Remove;
using Microsoft.Graph.Models;
var requestBody = new RemovePostRequestBody
{
Values = new List<ConversationMember>
{
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('alex@contoso.com')"
},
},
},
},
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Members.Remove.PostAsRemovePostResponseAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody();
LinkedList<ConversationMember> values = new LinkedList<ConversationMember>();
AadUserConversationMember conversationMember = new AadUserConversationMember();
conversationMember.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')");
conversationMember.setAdditionalData(additionalData);
values.add(conversationMember);
AadUserConversationMember conversationMember1 = new AadUserConversationMember();
conversationMember1.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('alex@contoso.com')");
conversationMember1.setAdditionalData(additionalData1);
values.add(conversationMember1);
removePostRequestBody.setValues(values);
var result = graphClient.teams().byTeamId("{team-id}").members().remove().post(removePostRequestBody);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph.generated.models.conversation_member import ConversationMember
from msgraph.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemovePostRequestBody(
values = [
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('alex@contoso.com')",
}
),
],
)
result = await graph_client.teams.by_team_id('team-id').members.remove.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Members.Remove;
using Microsoft.Graph.Models;
var requestBody = new RemovePostRequestBody
{
Values = new List<ConversationMember>
{
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
},
},
},
},
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Members.Remove.PostAsRemovePostResponseAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.teams.item.members.remove.RemovePostRequestBody();
LinkedList<ConversationMember> values = new LinkedList<ConversationMember>();
AadUserConversationMember conversationMember = new AadUserConversationMember();
conversationMember.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')");
conversationMember.setAdditionalData(additionalData);
values.add(conversationMember);
AadUserConversationMember conversationMember1 = new AadUserConversationMember();
conversationMember1.setOdataType("microsoft.graph.aadUserConversationMember");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("user@odata.bind", "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')");
conversationMember1.setAdditionalData(additionalData1);
values.add(conversationMember1);
removePostRequestBody.setValues(values);
var result = graphClient.teams().byTeamId("{team-id}").members().remove().post(removePostRequestBody);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph.generated.models.conversation_member import ConversationMember
from msgraph.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemovePostRequestBody(
values = [
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/v1.0/users('86503198-b81b-43fe-81ee-ad45b8848ac9')",
}
),
],
)
result = await graph_client.teams.by_team_id('team-id').members.remove.post(request_body)