Join Wintertainment 2021 to share your stories, have fun, earn community badges, and more!

Paging Through Results Using Offset and Limit

Applies to QAComplete 12.94 SaaS, last modified on December 06, 2021

By default, GET operations, which return a list of requested items, return only the first 25 items. To get a different set of items, you can use the offset and limit parameters in the query string of the GET request.

For example, the …/defects (GET) operation returns:

URL Description
…/defects Returns the first 25 defects (the default limit is 25).
…/defects?limit=10 Returns the first 10 defects.
…/defects?offset=5&limit=5 Returns defects 6..10.
…/defects?offset=10 Returns defects 11..36 (the default number of the returned defects is 25).

To page through all the available items, first, use the metadata section of the JSON response to get the total number of items.

{
   "metadata": {
      "result_set": {
         "count": 25,
         "offset": 0,
         "limit": 25,
         "total": 77
      },
      ...

Tip: You can request …/defects?limit=0 to get just metadata, without defect data.

Then send subsequent requests with increasing offsets and a fixed limit until you get all the data.

…/defects?offset=25&limit=25
…/defects?offset=50&limit=25
…/defects?offset=75&limit=25

See Also

QAComplete REST API Reference

Highlight search results