Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
Тип разрешения
Разрешения с наименьшими привилегиями
Более высокие привилегированные разрешения
Делегированные (рабочая или учебная учетная запись)
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
Делегированные (личная учетная запись Майкрософт)
Не поддерживается.
Не поддерживается.
Для приложений
Team.ReadBasic.All
TeamSettings.Read.All, TeamSettings.ReadWrite.All
HTTP-запрос
GET /teams
Необязательные параметры запросов
Этот метод поддерживает $filterпараметры запроса ,$select, $top, $skiptokenи $count OData для настройки ответа.
При успешном выполнении этот метод возвращает 200 OKкод ответа и коллекцию объектов team в теле ответа.
Примечание.
В настоящее время этот вызов API возвращает только свойства id, displayName и 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();
// 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()
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
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"
}
]
}
Пример 2. Использование параметров $filter и $top для получения двух команд с отображаемым именем, которое начинается с "А"
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)
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
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"
}
]
}
Пример 3. Использование параметров $filter и $select для получения ИД и описания команды с отображаемым именем "A Contoso Team" (Команда 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)
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
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"
}
]
}