Pagination

To retrieve data, you have to make requests to the REST API. The response of such a request can lead to a huge data set. To avoid this, awork smartly paginates the responses so that they are flexible and easier for users to handle.
For example, if you get all the projects, the response could end up with hundreds or thousands of projects and their details which, certainly creates a bad experience for your users. To avoid this, a built-in default limit on the server response is set, which varies on which data you are trying to retrieve. The limit is configurable, i.e., you can specify the number of results that you would like to receive from the server.

Configuring the number of items

You can set the number of items that you would like to retrieve from the API via two properties: page and pageSize.

Query ParamTypeDescription
pageintegerThe current page number
pageSizeintegerHow many items should be returned on each page, maximum of 1000

For example, if you want to get the first 50 users, you would make a request to the following URL: GET /users?page=1&pageSize=50.

Request
1curl https://api.awork.com/api/v1/users?page=1&pageSize=50

Response Headers

When you make a request to retrieve a list of entries from the API, you get the response as well as headers containing more pagination information. The following response headers are returned:

Header NameTypeDescription
aw-pageintegerThe current page
aw-pagesizeintegerThe current page size, 1000 by default
aw-itemsintegerThe items in the current page
aw-totalitemsintegerThe total items available (considering filters)