Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
Solicitud HTTP
GET /teams
Parámetros de consulta opcionales
Este método admite los $filterparámetros de consulta , $select, $top, $skiptokeny $count OData para ayudar a personalizar la respuesta.
No proporcione un cuerpo de solicitud para este método.
Respuesta
Si se ejecuta correctamente, este método devuelve un código de respuesta 200 OK y la colección de objetos team en el cuerpo de la respuesta.
Nota:
Actualmente, esta llamada a la API solo muestra las propiedades id, displayName y descripción de un equipo. Para obtener todas las propiedades, use la operación Obtener equipo.
// 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()
Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.
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"
}
]
}
Ejemplo 2: Usar $filter y $top para obtener dos equipos con un nombre para mostrar que comience por «A»
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)
Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.
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"
}
]
}
Ejemplo 3: Usar $filter y $select para obtener el identificador y la descripción del equipo cuyo displayName es igual a «Un equipo de Contoso»
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)
Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.
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"
}
]
}