I need to get the list of members from a SPA that is hosted as a tab in a private channel in Microsoft Teams. I know how to query it from this page. So the request is something like this:
GET https://graph.microsoft.com/beta/teams/<group_id>/channels/<channel_id>/members
The problem is from the SPA I couldn't get the groupId because in a private channel the context provided by Microsoft Teams SDK is undefined. I know that this is done to provide privacy for the channel. But, are there any other queries that I could use to get the members, or is there any other way to get groupId from a private channel?
Asked
Active
Viewed 1,276 times
0

ingmar ramzan shidqi
- 83
- 7
-
Hi @ingmar ramzan shidqi, To get the list of members from a private channel, you can call GET https://graph.microsoft.com/v1.0/me/joinedteams and get the corresponding Team ID/Group ID and call GET https://graph.microsoft.com/v1.0/Teams/{groupID}/channels/{PrivateChannelID}/members – Mallipriya-MSFT Mar 05 '21 at 11:04
-
is the issue resolved? – Mallipriya-MSFT Mar 07 '21 at 16:06
-
I haven't had the chance to test it yet. Most likely today I will. – ingmar ramzan shidqi Mar 08 '21 at 02:10
-
unfortunately, this doesn't work since private channels are not included in graph.microsoft.com/v1.0/me/joinedteams query result – ingmar ramzan shidqi Mar 10 '21 at 09:36
-
Get Teams ID from graph.microsoft.com/v1.0/me/joinedteams and call graph.microsoft.com/v1.0/Teams/{TeamsID}/Channels then you would get all the channels including private channels. – Mallipriya-MSFT Mar 10 '21 at 10:49
-
Oh ok, I get it now. It's just it may take many queries depending on the number of joined teams to get it right? – ingmar ramzan shidqi Mar 10 '21 at 11:20
-
Yes, this requires a work around with APIs. – Mallipriya-MSFT Mar 11 '21 at 08:48
1 Answers
0
Copying Answer from the comments
To get the list of members from a private channel, you can call GET graph.microsoft.com/v1.0/me/joinedteams and get the corresponding Team ID/Group ID and call GET graph.microsoft.com/v1.0/Teams{groupID}/channels/{PrivateChannelID}/members

Mallipriya-MSFT
- 236
- 1
- 3
-
The API you are referring to is documented at https://learn.microsoft.com/en-us/graph/api/channel-list-members – Simon Opelt Mar 26 '21 at 09:41