Skip to content

[Doc Feature] [Apps in shared channels - Notification for indirect membership update and notification for team (host/non-host) #13010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msteams-platform/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
displayName: Teams Store apps approved by Microsoft for mobile
- name: Apps for shared channels
href: concepts/build-and-test/shared-channels.md
displayName: Cross-tenant notifications, context for shared channel, apps and permissions in shared channels
displayName: Cross-tenant notifications, context for shared channel, apps and permissions in shared channels, notifications for indirect membership
- name: Send activity feed notifications
href: /graph/teams-send-activityfeednotifications?toc=/microsoftteams/platform/toc.json&bc=/microsoftteams/platform/breadcrumb/toc.json
displayName: activity feed, notification, customize notification
Expand Down
64 changes: 62 additions & 2 deletions msteams-platform/concepts/build-and-test/shared-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,72 @@ You can get direct shared channel membership by using the `hostTeamGroupID` from
GET /teams/{host-team-group-id}/channels/{channel-id}/sharedWithTeams
```

3. Use GET members of each shared team (Team X) with GET `sharedWithTeams` API.
3. Use GET members of each shared team (sharewithteamsId) with GET `sharedWithTeams` API.

```http
GET /teams/{host-team-group-id}/channels/{channel-id}/sharedWithTeams/{teamX}/members
GET /teams/{host-team-group-id}/channels/{channel-id}/sharedWithTeams/{sharewithteamsId}/allowedMembers
```

## Get notifications for indirect membership changes

Users can access a shared channel either directly (added to the channel) or indirectly (members of a team with which the channel is shared). Apps installed in shared channels can receive notifications when users are added to or removed from an associated team with which the channel is shared. To receive these notifications, you must:

* [Install the app](../deploy-and-publish/apps-upload.md) in a host team and enable it for the shared channel.
* Create a valid Microsoft Graph change notification subscription to monitor associated team membership changes and shared or unshared events using supported APIs.

To subscribe to indirect membership updates, use the following Microsoft Graph resource URL:

`/teams/{team-id}/channels/getAllMembers?notifyOnIndirectMembershipUpdate=true&suppressWhenSharedUnsharedWithTeam=true`

This subscription enables apps to monitor membership changes in shared channels and its associated teams. For more information on how to create a Microsoft Graph change notification subscription, see [Create a subscription.](/graph/teams-changenotifications-teammembership)

### Manage indirect membership in shared channels

You can manage indirect membership in shared channels using the following Microsoft Graph APIs:

* Use [allMembers](/graph/api/channel-list-allmembers?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to retrieve all users who are members of a specific channel.

```http
GET /teams/{team-id}/channels/{channel-id}/allMembers
```

* Use [sharedWithTeams](/graph/api/sharedwithchannelteaminfo-list?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to list all teams a channel is shared with.

```http
GET /teams/{team-id}/channels/{channel-id}/sharedWithTeams
```

* Use the [allowedMembers](/graph/api/sharedwithchannelteaminfo-list-allowedmembers?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to retrieve users from a shared team who can access a shared channel.

```http
GET /teams/{team-id}/channels/{channel-id}/sharedWithTeams/{sharewithteamsId}/allowedMembers
```

> [!NOTE]
> `allowedMembers` API returns only newly associated users and doesn't apply to unshared events.

### Validate user access

When an app receives a notification for an indirect membership update, it must validate user access to the shared channel. For example, if a user is removed from a team associated with a shared channel, use the following API to determine whether the user still has access to the shared channel. The API verifies whether the user still has access to the shared channel.

```http
GET /DoesUserHaveAccessAsync
```

### Handle bulk membership changes

In large-scale scenarios, such as sharing a channel with a large team or removing multiple users, Teams suppresses individual notifications to reduce volume.

To handle bulk membership changes:

* Use `allMembers` API to retrieve the complete updated list of current members.
* Use `allowedMembers` to retrieve only newly added members during shared events.
* Avoid using `DoesUserHaveAccessAsync` for every user unless necessary.
* Subscribe to shared and unshared events using supported Microsoft Graph APIs.

> [!NOTE]
> Apps using resource-specific consent (RSC) must request extended permissions to support both direct and indirect membership updates. These permissions are required to query membership data and respond to notifications.

## Classify members in the shared channel as in-tenant or out-tenant

You can classify members as in-tenant or out-tenant by comparing `tenantID` of the member or team with `hostTeamTenantID` as follows:
Expand Down
13 changes: 7 additions & 6 deletions msteams-platform/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ Discover Microsoft Teams platform features that are generally available (GA). Yo
:::column span="2":::

Teams platform features that are available to all app developers.</br>
**2025 May**
**2025 June**

* ***May 29, 2025***: [Introducing app manifest v1.22 with support for custom activity icons and prefetch of nested app authentication tokens.](/microsoft-365/extensibility/schema/?view=m365-app-1.22&preserve-view=true)
* ***May 19, 2025***: [Introducing Microsoft 365 admin center permission to view custom app analytics and the agent usage analytics for custom apps in Developer Portal.](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=custom-apps-built-for-your-org)
* ***May 19, 2025***: </br> Branding updates: </br> • Teams Toolkit is now Microsoft 365 Agents Toolkit. </br> • Teams App Test Tool is now Microsoft 365 Agents Playground. </br> • Teams App CLI, TeamFx CLI, and Teams Toolkit CLI are now Microsoft 365 Agents Toolkit CLI. </br> • `teamsapp` CLI signature is now referred as `atk`.
* ***May 16, 2025***: [Use Meeting AI Insights API to fetch conversation summaries, action items, and mentions directly from Teams meetings.](graph-api/meeting-transcripts/meeting-insights.md)
* ***May 13, 2025***: [Introducing agent usage analytics for third-party apps in Developer Portal](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=thirdpartyapps).
***June 27, 2025***: [Apps can now recieve notificarions when users are added to or removed from a shared channel through assoicated teams, helping developers maintain accurate access control](/microsoftteams/platform/concepts/build-and-test/shared-channels)

:::column-end:::
:::row-end:::
Expand All @@ -53,6 +49,11 @@ Teams platform features that are available to all app developers.</br>

| **Date** | **Update** | **Find here** |
| -------- | --------- | ----------------|
| 29/05/2025 | Introducing app manifest v1.22 with support for custom activity icons and prefetch of nested app authentication tokens.| [Microsoft 365 app manifest schema reference.](/microsoft-365/extensibility/schema/?view=m365-app-1.22&preserve-view=true) |
| 19/05/2025 | Branding updates: </br> • Teams Toolkit is now Microsoft 365 Agents Toolkit </br> • Teams App Test Tool is now Microsoft 365 Agents Playground </br> • Teams App CLI, TeamFx CLI, and Teams Toolkit CLI are now Microsoft 365 Agents Toolkit CLI </br> • `teamsapp` CLI signature is now `atk` | [Microsoft 365 Agent Toolkit](/microsoft-365/developer/overview-m365-agents-toolkit?toc=%2Fmicrosoftteams%2Fplatform%2Ftoc.json&bc=%2Fmicrosoftteams%2Fplatform%2Fbreadcrumb%2Ftoc.json) |
| 19/05/2025 | Introducing Microsoft 365 admin center permission to view custom app analytics and the agent usage analytics for custom apps in Developer Portal | Tools and SDKs > Tools > Developer Portal for Teams > [Analyze app and agent usage in Developer Portal](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=custom-apps-built-for-your-org) |
| 16/05/2025 | Use Meeting AI Insights API to fetch conversation summaries, action items, and mentions directly from Teams meetings | Build apps for Teams meetings and calls > Get meeting transcripts, recordings, and AI summaries > [Get AI-generated meeting summaries](graph-api/meeting-transcripts/meeting-insights.md) |
| 13/05/2025 | Introducing agent usage analytics for third-party apps in Developer Portal | Tools and SDKs > Tools > Developer Portal for Teams > [Analyze app and agent usage in Developer Portal](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=thirdpartyapps) |
| 30/04/2025 | Introducing streaming messages for bot apps. | Build bots and agents > Bot user experience > [Stream bot messages](bots/streaming-ux.md) |
| 21/04/2025 | Precache your tab app to optimize its initial load time. | Build tabs > Tab features > App caching for your tab app > [Debug tool for cached apps](tabs/how-to/app-caching.md#precaching-tab-apps) |
| 21/04/2025 | You can specify a 32x32 color icon with a transparent background to ensure a consistent appearance when your app runs in Outlook and Microsoft 365. | Publish your app or agent > Create Teams app package > [Color icon](concepts/build-and-test/apps-package.md#color-icon) |
Expand Down