Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Supprimez plusieurs membres d’une équipe dans une seule requête. La réponse fournit des détails sur les appartenances qui peuvent et n’ont pas pu être supprimées.
Dans le corps de la demande, fournissez la représentation JSON de la liste des dérivés conversationMember à supprimer d’une équipe. Un maximum de 20 dérivés conversationMember peuvent être supprimés dans une seule requête.
Le tableau suivant montre le paramètre que vous pouvez utiliser avec cette méthode.
Liste des membres de la conversation qui doivent être supprimés.
Réponse
Si elle réussit, cette méthode renvoie une 204 No Content réponse si tous les membres spécifiés ont été supprimés de l’équipe ou une 207 Multi-Status réponse si seuls certains membres ont été supprimés. L’appelant doit inspecter la charge utile de réponse pour identifier les suppressions de membres ayant échoué. Le corps de la réponse contient une collection de dérivés de la ressource actionResultPart . Si la requête échoue, l’API retourne une erreur. Pour plus d’informations sur les erreurs de Microsoft Graph, consultez l’article Types de ressources et réponses d’erreur Microsoft Graph.
Exemples
Exemple 1 : Supprimer des membres en bloc d’une équipe
L’exemple suivant montre comment supprimer plusieurs membres d’une équipe dans une seule requête.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teams.Item.Members.Remove;
using Microsoft.Graph.Beta.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/beta/users('18a80140-b0fb-4489-b360-2f6efaf225a0')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/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.beta.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.beta.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/beta/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/beta/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_beta import GraphServiceClient
from msgraph_beta.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph_beta.generated.models.conversation_member import ConversationMember
from msgraph_beta.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://learn.microsoft.com/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/beta/users('18a80140-b0fb-4489-b360-2f6efaf225a0')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/beta/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.Beta.Teams.Item.Members.Remove;
using Microsoft.Graph.Beta.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/beta/users('jacob@contoso.com')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/beta/users('alex@contoso.com')"
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/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.beta.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.beta.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/beta/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/beta/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_beta import GraphServiceClient
from msgraph_beta.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph_beta.generated.models.conversation_member import ConversationMember
from msgraph_beta.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://learn.microsoft.com/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/beta/users('jacob@contoso.com')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/beta/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.Beta.Teams.Item.Members.Remove;
using Microsoft.Graph.Beta.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/beta/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')"
},
},
},
new AadUserConversationMember
{
OdataType = "microsoft.graph.aadUserConversationMember",
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/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.beta.teams.item.members.remove.RemovePostRequestBody removePostRequestBody = new com.microsoft.graph.beta.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/beta/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/beta/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_beta import GraphServiceClient
from msgraph_beta.generated.teams.item.members.remove.remove_post_request_body import RemovePostRequestBody
from msgraph_beta.generated.models.conversation_member import ConversationMember
from msgraph_beta.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://learn.microsoft.com/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/beta/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')",
}
),
AadUserConversationMember(
odata_type = "microsoft.graph.aadUserConversationMember",
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')",
}
),
],
)
result = await graph_client.teams.by_team_id('team-id').members.remove.post(request_body)