Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
Community.Read.All
Community.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Community.Read.All
Community.ReadWrite.All
HTTP request
GET /employeeExperience/communities
Optional query parameters
This method supports the $top, $select, and $expandOData query parameters to help customize the response. It also supports the $orderby parameter for the displayName property.
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();
// 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)
// 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();
# 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()
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#employeeExperience/communities",
"value": [
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTEzMjYyODk5MjAifQ",
"displayName": "All Company",
"description": "This is the default group for everyone in the network",
"privacy": "public",
"groupId": "195d9ecd-f80e-4bab-af95-176eba253dfa"
},
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTE0NzY2Mzc2OTYifQ",
"displayName": "TestCommunity5",
"description": "Test community created via API",
"privacy": "public",
"groupId": "0bed8b86-5026-4a93-ac7d-56750cc099f1"
}
]
}
Example 2: Get a list of communities with pagination
The following example shows how to get a list of Viva Engage communities using the $top query parameter to set the page size of results.
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;
});
// 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)
// 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;
});
# 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)
If the number of communities exceeds 20 or you use the $top query parameter to set the page size of results, multiple query requests might be necessary to retrieve all results. In this scenario, the API continues to return a reference to the next page of results in the @odata.nextLink property with each response until no more pages remain to be retrieved.
The following example shows the response that includes the @odata.nextLink property.
Note: The response object shown here might be shortened for readability.
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=UVWlYzI7VjE7MTE2NDUzNDU3OTIwOzIwO0RlbW8tdGVzdC01OztEaXNwbGF5TmFtZTtmYWXYZTs",
"value": [
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTEzMjYyODk5MjAifQ",
"displayName": "All Company",
"description": "This is the default group for everyone in the network",
"privacy": "public",
"groupId": "195d9ecd-f80e-4bab-af95-176eba253dfa"
},
{
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTE0NzY2Mzc2OTYifQ",
"displayName": "TestCommunity5",
"description": "Test community created via API",
"privacy": "public",
"groupId": "0bed8b86-5026-4a93-ac7d-56750cc099f1"
}
]
}