PractiTest Discussion Forum

Pagination does not work as expected

In our project there are 107 tests right now (and will be more) and I want to get all of them in one API request for further processing. By default there can be 100 entries in one response page and I’m not able to change this using ‘Pagination’.

Example 1
When I run:

https://api.practitest.com/api/v2/projects/{{project_id}}/tests.json?developer_email={{developer_email}}&api_token={{api_token}}&page[number]=1&page[size]=2

I got only two tests and ‘meta’ is as expected:

"meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 54,
    "total-count": 107
}

Example 2
But when I run:

https://api.practitest.com/api/v2/projects/{{project_id}}/tests.json?developer_email={{developer_email}}&api_token={{api_token}}&page[number]=1&page[size]=150

I expect to get only one page with all 107 tests, but got ‘meta’:

"meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 2,
    "total-count": 107
}

In example 1 the ‘pagination’ works as expected but in example 2 there is some problem. Have I missed something? Thanks for answer.

Hi,

Please note that the maximum number of entities can be get per page is 100 and that’s why you can’t get more than 100 tests per page.

Hope this helps.

Thanks for the reply, maybe mention about max value on the online help pagination page speeds things up :wink:

Thanks for this good idea, added.

Best,
Christine