Skip to content

Commit 3a71f92

Browse files
committed
fix perms issue
1 parent 8f6fac2 commit 3a71f92

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/sim/tools/microsoft_teams/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ async function fetchChannelMembers(
180180
channelId: string,
181181
accessToken: string
182182
): Promise<TeamMember[]> {
183+
// Channel members endpoint requires ChannelMember.Read.All which may not be available
184+
// Instead, fetch team members which works with the standard Teams permissions
183185
const response = await fetch(
184-
`https://graph.microsoft.com/v1.0/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/members`,
186+
`https://graph.microsoft.com/v1.0/teams/${encodeURIComponent(teamId)}/members`,
185187
{
186188
headers: {
187189
Authorization: `Bearer ${accessToken}`,
@@ -191,7 +193,7 @@ async function fetchChannelMembers(
191193
)
192194

193195
if (!response.ok) {
194-
logger.error('Failed to fetch channel members:', {
196+
logger.error('Failed to fetch team members:', {
195197
status: response.status,
196198
statusText: response.statusText,
197199
})
@@ -205,7 +207,7 @@ async function fetchChannelMembers(
205207
userIdentityType: member.userIdentityType,
206208
}))
207209

208-
logger.info('Fetched channel members:', {
210+
logger.info('Fetched team members for channel:', {
209211
count: members.length,
210212
members: members.map((m: TeamMember) => ({
211213
displayName: m.displayName,

0 commit comments

Comments
 (0)