Cloud HostingLaunch UnoPim on fully-managed cloud hosting — fast, secure and cost-effective plans.
Skip to content

Response Structure Explained

Every paginated response in this API shares the same shape, and this page walks you through it. Once you understand the three top-level keys — data, links, and meta — you can navigate any list endpoint.

Taking the categories endpoint as an example, a paginated response looks like this:

json
{
    "data": [{...},{...},...,{...}],
    "links": {...},
    "meta": {...}
}

The Data Object

The data key holds the collection of records themselves — in this example, the UnoPim store's categories. Its shape matches the single-record response of the same resource.

The links key gives you ready-made URLs for moving between pages:

json
"links": {
    "first": "https://example.com/api/categories?limit=5&pagination=342234&page=1",
    "last": "https://example.com/api/categories?limit=5&pagination=342234&page=2",
    "prev": null,
    "next": "https://example.com/api/categories?limit=5&pagination=342234&page=2"
}

Each link serves a distinct purpose:

NameInfo
firstDisplay the first url link of the called API with filter variable.
lastDisplay the last url link of the called API with filter variable.
prevDisplay the previous url of the current called API url.
nextDisplay the next url of the current called API url. If no next url available then it will contain the null value.

The Meta Object

The meta key appears only on paginated responses and describes where you are in the result set:

json
"meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 2,
    "path": "https://example.com/api/categories",
    "per_page": "5",
    "to": 5,
    "total": 10
}

Here is what each field tells you:

NameInfo
current_pageDisplay the current page number.
fromDisplay the first count of the returned data object based on the provided page and limit filters.
last_pageDisplay the last page number.
pathDisplay the current api url without input parameters.
per_pageDisplay the total of records in a single page.
toDisplay the last count of the returned data object based on the provided page and limit filters.
totalDisplay the total number of records in the store.

Released under the MIT License.