名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
このチーム内またはこのチームと共有されているチャネル (受信チャネル) の一覧を取得します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Channel.ReadBasic.All |
ChannelSettings.Read.All、ChannelSettings.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
Channel.ReadBasic.All |
ChannelSettings.Read.All、ChannelSettings.ReadWrite.All |
注: この API は、管理者のアクセス許可をサポートします。 Microsoft Teamsサービス管理者は、メンバーではないチームにアクセスできます。
HTTP 要求
GET /teams/{team-id}/allChannels
オプションのクエリ パラメーター
このメソッドは、応答をカスタマイズするための $filter および $selectOData クエリ パラメーターをサポートします。
チャネルの 電子メール プロパティの設定は、パフォーマンスが低下する高価な操作です。
$selectを使用して、パフォーマンスを向上させるために電子メール プロパティを除外します。
注: この API では、チャネルの moderationSettings プロパティは 既定では返されません。 このプロパティを取得するには、 $select クエリ パラメーターを使用します。
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で channel オブジェクトのコレクションを返します。 応答には @odata.id プロパティも含まれています。これは、チャネルへのアクセスや チャネル オブジェクトに 対するその他の操作の実行に使用できます。
注:
現在、@odata.id プロパティから返された URL の呼び出しは、クロステナント共有チャネルでは失敗します。 この API を呼び出す前に URL から /tenants/{tenant-id} パーツを削除すると、この問題を解決できます。 詳細については、「Microsoft Graph に関する既知の問題」を参照してください。
例
例 1: すべてのチャネルを一覧表示する
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/teams/893075dd-2487-4122-925f-022c42e20265/allChannels
// 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}"].AllChannels.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
allChannels, err := graphClient.Teams().ByTeamId("team-id").AllChannels().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}").allChannels().get();
const options = {
authProvider,
};
const client = Client.init(options);
let allChannels = await client.api('/teams/893075dd-2487-4122-925f-022c42e20265/allChannels')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->teams()->byTeamId('team-id')->allChannels()->get()->wait();
Import-Module Microsoft.Graph.Beta.Teams
Get-MgBetaAllTeamChannel -TeamId $teamId
# 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').all_channels.get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.id": "https://graph.microsoft.com/beta/tenants/b3246f44-b4gb-4627-96c6-25b18fa2c910/teams/893075dd-2487-4122-925f-022c42e20265/channels/19:561fbdbbfca848a484f0a6f00ce9dbbd@thread.tacv2",
"id": "19:561fbdbbfca848a484f0a6f00ce9dbbd@thread.tacv2",
"createdDateTime": "2020-05-27T19:22:25.692Z",
"displayName": "General",
"description": "AutoTestTeam_20210311_150740.2550_fim3udfdjen9",
"membershipType": "standard",
"layoutType": null,
"isArchived": false,
"tenantId": "b3246f44-b4gb-4627-96c6-25b18fa2c910"
},
{
"@odata.id": "https://graph.microsoft.com/beta/tenants/b3246f44-b4gb-5678-96c6-25b18fa2c910/teams/893075dd-5678-5634-925f-022c42e20265/channels/19:561fbdbbfca848a484gabdf00ce9dbbd@thread.tacv",
"id": "19:561fbdbbfca848a484gabdf00ce9dbbd@thread.tacv2",
"createdDateTime": "2020-05-27T19:22:25.692Z",
"displayName": "Shared channel from Contoso",
"membershipType": "shared",
"layoutType": null,
"isArchived": false,
"tenantId": "b3246f44-b4gb-5678-96c6-25b18fa2c910"
}
]
}
注:
この API には、チャネルの一覧表示に関連する 既知の問題 があります。
layoutType プロパティは、チャネルを一覧表示するときにnullを返します。 特定のチャネルのレイアウトの種類を取得するには、 チャネルの取得 API を 使用します。 リスト操作での layoutType の完全なサポートは、今後のリリースで予定されています。
例 2: すべての共有チャネルを一覧表示する
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/teams/893075dd-2487-4122-925f-022c42e20265/allChannels?$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}"].AllChannels.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.ItemAllChannelsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphteams.ItemAllChannelsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
allChannels, err := graphClient.Teams().ByTeamId("team-id").AllChannels().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}").allChannels().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "membershipType eq 'shared'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let allChannels = await client.api('/teams/893075dd-2487-4122-925f-022c42e20265/allChannels')
.version('beta')
.filter('membershipType eq \'shared\'')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teams\Item\AllChannels\AllChannelsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AllChannelsRequestBuilderGetRequestConfiguration();
$queryParameters = AllChannelsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "membershipType eq 'shared'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->teams()->byTeamId('team-id')->allChannels()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Teams
Get-MgBetaAllTeamChannel -TeamId $teamId -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.all_channels.all_channels_request_builder import AllChannelsRequestBuilder
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 = AllChannelsRequestBuilder.AllChannelsRequestBuilderGetQueryParameters(
filter = "membershipType eq 'shared'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.teams.by_team_id('team-id').all_channels.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.id": "https://graph.microsoft.com/beta/tenants/b3246f44-b4gb-5678-96c6-25b18fa2c910/teams/893075dd-5678-5634-925f-022c42e20265/channels/19:561fbdbbfca848a484gabdf00ce9dbbd@thread.tacv",
"id": "19:561fbdbbfca848a484gabdf00ce9dbbd@thread.tacv2",
"createdDateTime": "2020-05-27T19:22:25.692Z",
"displayName": "Shared channel from Contoso",
"membershipType": "shared",
"layoutType": null,
"tenantId": "b3246f44-b4gb-5678-96c6-25b18fa2c910",
"email": "someperson@microsoft.com",
"moderationSettings": null,
"isArchived": false,
"tenantId": "b3246f44-b4gb-5678-96c6-25b18fa2c910"
}
]
}