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 .
Cette API prend en charge les autorisations d’administrateur. Les utilisateurs disposant du rôle Administrateur général ou Administrateur de service Microsoft Teams peuvent accéder aux équipes dont ils ne sont pas membres.
Les autorisations Group.Read.All, Group.ReadWrite.All, Directory.Read.All et Directory.ReadWrite.All sont prises en charge uniquement pour la compatibilité descendante. Nous vous recommandons de mettre à jour vos solutions pour utiliser une autorisation différente répertoriée dans le tableau précédent et d’éviter d’utiliser ces autorisations à l’avenir.
Requête HTTP
GET /teams/{team-id}/channels
Paramètres facultatifs de la requête
Cette méthode prend en charge les paramètres de requête $filter et $selectOData pour aider à personnaliser la réponse.
Utiliser $select pour de meilleures performances
Le remplissage de la propriété d’e-mail d’un canal est une opération coûteuse qui entraîne des performances lentes. Utilisez $select pour exclure la propriété email afin d’améliorer les performances.
Remarque : Cette API ne retourne pas la propriété moderationSettings pour un canal par défaut. Pour obtenir cette propriété, utilisez le paramètre de $select requête .
GET https://graph.microsoft.com/beta/teams/893075dd-2487-4122-925f-022c42e20265/channels
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].Channels.GetAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
channels, err := graphClient.Teams().ByTeamId("team-id").Channels().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ChannelCollectionResponse result = graphClient.teams().byTeamId("{team-id}").channels().get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.teams.by_team_id('team-id').channels.get()
GET https://graph.microsoft.com/beta/teams/64c323f2-226a-4e64-8ba4-3e6e3f7b9330/channels?$filter=membershipType eq 'private'
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].Channels.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "membershipType eq 'private'";
});
// 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"
graphteams "github.com/microsoftgraph/msgraph-beta-sdk-go/teams"
//other-imports
)
requestFilter := "membershipType eq 'private'"
requestParameters := &graphteams.TeamItemChannelsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphteams.TeamItemChannelsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
channels, err := graphClient.Teams().ByTeamId("team-id").Channels().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ChannelCollectionResponse result = graphClient.teams().byTeamId("{team-id}").channels().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "membershipType eq 'private'";
});
# 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.channels.channels_request_builder import ChannelsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = ChannelsRequestBuilder.ChannelsRequestBuilderGetQueryParameters(
filter = "membershipType eq 'private'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.teams.by_team_id('team-id').channels.get(request_configuration = request_configuration)
GET https://graph.microsoft.com/beta/teams/6a720ba5-7373-463b-bc9f-4cd04b5c6742/channels?$filter=membershipType eq 'shared'
// Code snippets are only available for the latest version. Current version is 5.x
// 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}"].Channels.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "membershipType eq 'shared'";
});
// 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"
graphteams "github.com/microsoftgraph/msgraph-beta-sdk-go/teams"
//other-imports
)
requestFilter := "membershipType eq 'shared'"
requestParameters := &graphteams.TeamItemChannelsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphteams.TeamItemChannelsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
channels, err := graphClient.Teams().ByTeamId("team-id").Channels().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ChannelCollectionResponse result = graphClient.teams().byTeamId("{team-id}").channels().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "membershipType eq 'shared'";
});
# 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.channels.channels_request_builder import ChannelsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = ChannelsRequestBuilder.ChannelsRequestBuilderGetQueryParameters(
filter = "membershipType eq 'shared'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.teams.by_team_id('team-id').channels.get(request_configuration = request_configuration)