As adoption of Webex Teams continues to skyrocket, so does the amount of content being shared by team members. We've addressed this in the Webex Teams APIs by introducing support for pagination.

It would be impractical to return all messages in a busy room, for example. With pagination, the Webex Teams API returns a specific number of items at a time; allowing your app to request another page as needed.

Navigating Pages

The Webex Teams APIs implement the RFC5988 (Web Linking) standard for pagination. When requesting a list of resources the response may contain a Link header containing the URLs to the first, next, and previous page.

For example, requesting GET /people?displayName=Harold may return a link header like this one:

Link: <> rel="next"

Notice the rel="next" at the end of the line. This tells your app that another page is available and provides the URL to fetch it.

The list of possible relationship types are:

next Link to the next page
first Link back to the first page
prev Link to the previous page

Please note that only the rel="next" link header is guaranteed at this time. We may include other link types, that are defined in the RFC5988 (Web Linking) standard, in the future.

Controlling Page Size

When requesting a list of resources the max query parameter may be used to control the number of items returned per page. For example, requesting GET /people?displayName=Harold&max=2 tells the API to return only 2 items per page.

If the requested max query parameter value exceeds what a particular API endpoint allows, only the maximum number of items allowed per page for that endpoint will be returned. A rel="next" link header will be present if another page of results is available.