Getting nextPage for a teams search

I'm implementing search operations on various objects. E.g. a group. I'd load all results as follows (fullowing the NextPage since it contains the q64 value

var res = await new GroupApi().PostGroupsSearchAsync(new GroupSearchRequest()).ConfigureAwait(false);
result.Result = res.Results;
while (res.NextPage != null)
{
    res = await api.GetGroupsSearchAsync(res.NextPage).ConfigureAwait(false);
    if (res.Results != null)
        result.Result.AddRange(res.Results);
}

When I look at the Teams object instead, there's an equivalent to start the search (PostTeamsSearchAsync ) but no GetTeamsSearchAsync to fetch page 2, 3, etc. of the results. Looking at the API explorer, I'm not seeing an API to continue the search either. So, how would I fetch subsequent pages of a search on the Team object?

Refer to Paging section -

The page you linked to works on list operations, where you can work with pageSize and pageNumber.
I'm talking about search operations which work differently. The search gets you the first page, but subsequent search operations require a q64 string. For instance, searching users.. the first Request is POST

POST
/api/v2/users/search

If the result contains more than one page, you have to fetch additional pages with a search token. Here's the two API request in the API explorer:


there's no pageSize and page in the GET request :wink:

For the teams API, the response for POST /api/v2/teams/search is this:

As you can see, the nextPage contains a q64 value. But there's no corresponding GET /api/v2/teams/search that could take that q64 value. So, I guess the documentation lacks that operation, hence the SDK which is autogenerated also doesn't have a matching operation

The GET version of users uses Q64s from the post.

The post allows standard pagination but also provides Q64s for one forward one back.

You only use the GET to revisit a search you've already done. The POST already had the results so you shouldn't really need to GET the result of every post.

Because that is redundant Teams doesn't appear to implement the GET.
You can just paginate the post the way you would any other list and ignore the Q64s as extraneous.

So if we're supposed to page/pageSize in the POST to the search endpoint, shouldn't the corresponding GET operations that use the q64 be deprecated and eventually be removed?

Someone somewhere probably has a use case for it that made removing it not worth pursuing but teams is new and they have no incentive to add pointless things just to make it look similar. As far as I can tell their development teams operate off whimsy as much as guidelines, that's why they have so many conflicting ways of doing things.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.