Wählen Sie für diese API die Als am wenigsten privilegierten Berechtigungen gekennzeichneten Berechtigungen aus. Verwenden Sie nur dann eine Berechtigung mit höheren Berechtigungen , wenn dies für Ihre App erforderlich ist. 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)
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Nicht unterstützt
Anwendung
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
HTTP-Anforderung
GET /teams
Optionale Abfrageparameter
Diese Methode unterstützt die $filterOData-Abfrageparameter , $select$top, $skiptoken, und $count zum Anpassen der Antwort.
Geben Sie keinen Anforderungstext für diese Methode an.
Antwort
Wenn die Methode erfolgreich verläuft, werden der Antwortcode 200 OK und eine Sammlung von team-Objekten im Antworttext zurückgegeben.
Hinweis
Derzeit gibt dieser API-Aufruf nur die Eigenschaften id, displayNameund description eines Teams zurück. Um alle Eigenschaften abzurufen, verwenden Sie die Operation Team abrufen.
// 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.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamCollectionResponse result = graphClient.teams().get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph 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.get()
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
"displayName": "Contoso Team",
"description": "This is a Contoso team, used to showcase the range of properties supported by this API"
},
{
"id": "890972b0cce-e65d-44ce-9a49-568hhsd7n",
"displayName": "Contoso General Team",
"description": "This is a general Contoso team"
},
{
"id": "98678abcce0-e65d-44ce-9a49-9980bj8kl0e",
"displayName": "Contoso API Team",
"description": "This is Contoso API team"
}
]
}
Beispiel 2: Verwenden von $filter und $top, um zwei Teams mit einem Anzeigenamen abzurufen, der mit „A“ beginnt
GET https://graph.microsoft.com/v1.0/teams?$filter=startswith(displayName, 'A')&$top=2
// 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.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "startswith(displayName, 'A')";
requestConfiguration.QueryParameters.Top = 2;
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphteams "github.com/microsoftgraph/msgraph-sdk-go/teams"
//other-imports
)
requestFilter := "startswith(displayName, 'A')"
requestTop := int32(2)
requestParameters := &graphteams.TeamsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
Top: &requestTop,
}
configuration := &graphteams.TeamsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamCollectionResponse result = graphClient.teams().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "startswith(displayName, 'A')";
requestConfiguration.queryParameters.top = 2;
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.teams_request_builder import TeamsRequestBuilder
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 = TeamsRequestBuilder.TeamsRequestBuilderGetQueryParameters(
filter = "startswith(displayName, 'A')",
top = 2,
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.teams.get(request_configuration = request_configuration)
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
"displayName": "A Contoso Team",
"description": "This is a Contoso team, used to showcase the range of properties supported by this API"
},
{
"id": "890972b0cce-e65d-44ce-9a49-568hhsd7n",
"displayName": "A Contoso Notification Team",
"description": "This is a notification Contoso team"
}
]
}
Beispiel 3: Verwenden von $filter und $select, um die ID und Beschreibung für das Team mit displayName „A Contoso Team“ abzurufen.
GET https://graph.microsoft.com/v1.0/teams?$filter=displayName eq 'A Contoso Team'&$select=id,description
// 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.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "displayName eq 'A Contoso Team'";
requestConfiguration.QueryParameters.Select = new string []{ "id","description" };
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphteams "github.com/microsoftgraph/msgraph-sdk-go/teams"
//other-imports
)
requestFilter := "displayName eq 'A Contoso Team'"
requestParameters := &graphteams.TeamsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
Select: [] string {"id","description"},
}
configuration := &graphteams.TeamsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamCollectionResponse result = graphClient.teams().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "displayName eq 'A Contoso Team'";
requestConfiguration.queryParameters.select = new String []{"id", "description"};
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.teams_request_builder import TeamsRequestBuilder
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 = TeamsRequestBuilder.TeamsRequestBuilderGetQueryParameters(
filter = "displayName eq 'A Contoso Team'",
select = ["id","description"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.teams.get(request_configuration = request_configuration)
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
"description": "This is a Contoso team, used to showcase the range of properties supported by this API"
}
]
}