SOLVED

how to get user id from the endpoint /teams/{team-id}/channels/{channel-id}/members

Brass Contributor

is there a way to get the userid when we use get members of the channel endpoint.

5 Replies
I think, you need to use "userId" instead of id.

@ChetanSharma-msft , 
i am notable to point to the userId from the response, it seems to not have that field in response. 
i don't see any userID here.

Umag98_0-1644300899641.png

 

using graph sdk version 4.0.0

@Umag98 -  As per documentation, we should get the userId also in response.
Reference doc: List members of a channel - Microsoft Graph v1.0 | Microsoft Docs

Can you please try with Graph API call using postman or Graph Explorer and check it once.

@ChetanSharma-msft - 
it is not just to the members of channel, but also to chat members. 
get members of chat , i have tried in graph explorer it seems to get the userId for chat but in graph sdk

best response confirmed by ChetanSharma-msft (Microsoft)
Solution
i have figured it out , we have to cast it ((AadUserConversationMember)res).UserId.
Thanks for your replies
1 best response

Accepted Solutions
best response confirmed by ChetanSharma-msft (Microsoft)
Solution
i have figured it out , we have to cast it ((AadUserConversationMember)res).UserId.
Thanks for your replies

View solution in original post