When using the microsoft teams graph api to get list of members in a team, I'm also getting the owner names as part of the list. Is there any easy way to get just the members? Currently I'm using a complicated method of making two graph calls, one for owners and another for members and then manually comparing and eliminating owners from the member list.
0
votes
Could you please try using query parameters to filter the response based on a condition.
- Gousia Begum
I tried looking for any differences in the objects returned for member vs owner, but couldn't find anything differentiating the owner, so query parameters won't help
- Perumal Perumal
Currently, owners are also considered as members inside a team. You could get intersection with List Owners to get all members. Currently, we do not have any plans to change this behaviour.
- Gousia Begum
1 Answers
0
votes
If you have a Bot as part of your project, then instead of using the Graph you can use the latest release of the Bot Framework to get the relevant people. See the V4.9 release note of the bot framework, which state:
The TeamsChannelAccount object has been updated to include userRole (one of owner, member, or guest) and tenantId (for the user's tenantId).