Search code examples
botframeworkmicrosoft-teams

Teams BotFrameword SDK - getPagedMembers


I am trying to make use of the MS Teams BotFramework SDK getPagedMembers API [link to docs].

The documentation is pretty bare but it looks like it would be paginated.

I would like to test my code is correctly handling the continuation token but I am unable to hit a team with enough members to trigger the pagination (I don't even know what the max page size is!). The highest team size I have is 17.

Setting the page size low still just return all 17 members.

Does anyone know if there is a dummy team with hundreds of users that I could hit to test? Failing that, is there any examples that I've missed that I could check my code against.

Cheers Jon


Solution

  • For get conversation members, minimum or maximum page size depends on the implementation.

    1.The API accepts pageSize query parameter:

    • If the pageSize set by developer is <50, Teams API treats it as 50
    • If the pageSize is >500, Teams API will cap it to 500

    2.Teams API will fetch the members with the updated page size from step 1

    3.If the returned member count is less than or equal to the updated page size in step-1, there won't be continuation token returned to the bot

    For example,if the team has only 25 users and bot sets the pageSize to 25, our API will adjust it to 50 and fetch the members. Since the returned member count (25) is less than the requested number (50), so there won't be any continuation token returned

    FYI, Pagination is not supported in chats. Currently it's only available in team and channel.