名前空間: microsoft.graph
Viva Engage コミュニティ オブジェクトとそのプロパティの一覧を取得します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Community.Read.All |
Community.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
Community.Read.All |
Community.ReadWrite.All |
HTTP 要求
GET /employeeExperience/communities
オプションのクエリ パラメーター
このメソッドは、応答のカスタマイズに役立つ $top、 $select、および $expandOData クエリ パラメーター をサポートします。 また、displayName プロパティの $orderby パラメーターもサポートしています。
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文の コミュニティ オブジェクトのコレクションを返します。
例
例 1: コミュニティの一覧を取得する
次の例は、Viva Engage コミュニティの一覧を取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/v1.0/employeeExperience/communities
// 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.EmployeeExperience.Communities.GetAsync();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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
communities, err := graphClient.EmployeeExperience().Communities().Get(context.Background(), nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CommunityCollectionResponse result = graphClient.employeeExperience().communities().get();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
let communities = await client.api('/employeeExperience/communities')
.get();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->employeeExperience()->communities()->get()->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# 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.employee_experience.communities.get()
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#employeeExperience/communities",
"value": [
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ",
"displayName": "All Company",
"description": "This is the default group for everyone in the network",
"privacy": "public",
"groupId": "195d9ecd-f80e-4bab-af95-176eba253dff"
},
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzNDY2Mzc2OTYifQ",
"displayName": "TestCommunity5",
"description": "Test community created via API",
"privacy": "public",
"groupId": "0bed8b86-5026-4a93-ac7d-56750cc099aa"
}
]
}
次の例では、$top クエリ パラメーターを使用してViva Engage コミュニティの一覧を取得し、結果のページ サイズを設定する方法を示します。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/v1.0/employeeExperience/communities?$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.EmployeeExperience.Communities.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Top = 2;
});
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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"
graphemployeeexperience "github.com/microsoftgraph/msgraph-sdk-go/employeeexperience"
//other-imports
)
requestTop := int32(2)
requestParameters := &graphemployeeexperience.EmployeeExperienceCommunitiesRequestBuilderGetQueryParameters{
Top: &requestTop,
}
configuration := &graphemployeeexperience.EmployeeExperienceCommunitiesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
communities, err := graphClient.EmployeeExperience().Communities().Get(context.Background(), configuration)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CommunityCollectionResponse result = graphClient.employeeExperience().communities().get(requestConfiguration -> {
requestConfiguration.queryParameters.top = 2;
});
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
let communities = await client.api('/employeeExperience/communities')
.top(2)
.get();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\EmployeeExperience\Communities\CommunitiesRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CommunitiesRequestBuilderGetRequestConfiguration();
$queryParameters = CommunitiesRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->top = 2;
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->employeeExperience()->communities()->get($requestConfiguration)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.employee_experience.communities.communities_request_builder import CommunitiesRequestBuilder
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 = CommunitiesRequestBuilder.CommunitiesRequestBuilderGetQueryParameters(
top = 2,
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.employee_experience.communities.get(request_configuration = request_configuration)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
コミュニティの数が 20 を超える場合、または $top クエリ パラメーターを使用して結果のページ サイズを設定する場合は、すべての結果を取得するために複数のクエリ要求が必要になることがあります。 このシナリオでは、API は結果の次のページへの参照を引き続き返し、各応答を 持つ @odata.nextLink プロパティは、それ以上のページが取得されるまで返されます。
次の例は、 @odata.nextLink プロパティを含む応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#employeeExperience/communities",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/employeeExperience/communities?$skiptoken=UVWlYzI7VjE7MTE2NDUzNDU3OTIwOzIwO0RlbW8tdGVzdC01OztEaXNwbGF5TmFtZTtmYWXYYTs",
"value": [
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ",
"displayName": "All Company",
"description": "This is the default group for everyone in the network",
"privacy": "public",
"groupId": "195d9ecd-f80e-4bab-af95-176eba253dff"
},
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzNDY2Mzc2OTYifQ",
"displayName": "TestCommunity5",
"description": "Test community created via API",
"privacy": "public",
"groupId": "0bed8b86-5026-4a93-ac7d-56750cc099aa"
}
]
}