Graph Explorer
Graph Explorer is a great tool for showcasing the capabilities of the Graph API. It even comes with a sample tenant you can test your queries against. The same queries can, of course, be reproduced in Postman and your future applications. For our purpose of testing the Viva Engage Community API, we will use Graph Explorer. If it’s your first time using Graph Explorer or Graph API, you can check out the Graph Explorer Overview.
Get all communities
Method | Url |
---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities |
In order to get all Viva Engage communities using Graph API, use the GET method with the following url: https://graph.microsoft.com/beta/employeeexperience/communities
Get specific community
a) by id
Method | Url |
---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID |
In order to get a specific Viva Engage community, use its ID. In the case of the sample tenant used in Graph Explorer, it’s eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxMjczMDI1MyJ9. Use the GET method with the following url: https://graph.microsoft.com/beta/employeeexperience/communities/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxMjczMDI1MyJ9
b) by name
Method | Url |
---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities?$filter=displayName eq ‘Marketing’ |
Use $filter to filter for your Viva Engage community’s name. The API call fetches details about a community named “Marketing” and returns data such as community ID, display name, description, and other related properties.
See the full documentation for this GET request here.
Get community owners
Method | Url |
---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID/owners |
Using GET Method and Url https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID/owners you can also retrieve the owners of the community.
Use ?$select=displayName to select the properties of the owners that interest you:
Get associated group
Method | Url |
---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID/group |
Gets the Microsoft 365 group associated with the Viva Engage community. The M365 group is crucial for the management of the community. You can manage community operations through the associated Microsoft 365 group by adding or removing members, managing ownership, deleting or renaming the group, and updating its description.
community resource type
Represents a community in Viva Engage. Each community is linked to a Microsoft 365 group, although the group does not share the same ID as the community.
Property | Type | Description |
---|---|---|
description | String | The description of the community. The maximum length is 1024 characters. |
displayName | String | The name of the community. The maximum length is 255 characters. |
groupId | String | The ID of the Microsoft 365 group that manages the membership of this community. |
id | String | The unique identifier of the community. Read only. Inherited from entity. |
privacy | communityPrivacy | Defines the privacy level of the community. The possible values are: public, private, unknownFutureValue (don’t use). |
Create a new community
Method | Url |
---|---|
POST | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID |
Mind that every Viva Engage community is associated with a Microsoft 365 group, but the group doesn’t have the same ID as the community. In order to create a new community, use POST method and the following body:
You can also use Graph Explore to generate a code snippet in C#, CLI, Java, and other languages for Viva Engage community creation:
Modify your community
For Viva Engage networks in native mode, creating a new Viva Engage community also generates a connected Microsoft 365 group, as well as a new SharePoint site, OneNote notebook, and Planner plan. You can use the associated Microsoft 365 group to manage community operations, such as:
- Add or remove group members
- Manage group ownership
- Delete a group
- Rename a group
- Update the group description
Summary
Method | Url | Description |
---|---|---|
GET | https://graph.microsoft.com/beta/employeeexperience/communities | Gets all communities |
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID | Gets specific community |
GET | https://graph.microsoft.com/beta/employeeexperience/communities?$filter=displayName eq ‘Marketing’ | Gets community by name |
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID/owners | Gets community owners |
GET | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID/group | Gets associated M365 group |
POST | https://graph.microsoft.com/beta/employeeexperience/communities/COMMUNITYID | Creates a community |
See Also
Introducing the Community Creation API for Viva Engage on Microsoft Graph Beta