Query & Pagination
For APIs that provide search, filtering, and pagination:
Filter
To filter result sets from queryable APIs, we support the following query param filter
:
Operator | Format | Description |
---|---|---|
eq | eq(column:val) | perform column=value operation |
neq | neq(column:val) | perform column!=value operation |
gt | gt(column:val) | perform column>value operation |
gte | gte(column:val) | perform column>=value operation |
lt | lt(column:val) | perform column<value operation |
lte | lte(column:val) | perform column<=value operation |
like | like(column:val*) | perform like val% operation |
nlike | nlike(column:*val) | perform like %val operation |
in | in(column:val, val1, val2, …) | perform in (val, val1, val2, ....) operation |
nin | nin(column:val, val1, val2, …) | perform not in (val, val1, val2, ....) operation |
For example:
curl --request GET 'https://api.boldcommerce.com/products/v2/shops/{shop_identifier}/products?filter=eq(id:11)+eq(name:test)' \
--header 'Authorization: Bearer {access_token}' \
--header 'Bold-API-Version-Date: 2022-05-01'
Pagination
Paging through data can be accomplished by using the following request parameters:
since_id
— Restricts results to after the specified ID.limit
— Limits the number of results per-page. Maximum 100.
For example:
curl --request GET 'https://api.boldcommerce.com/products/v2/shops/{shop_identifier}/products?since_id=123&limit=100' \
--header 'Authorization: Bearer {access_token}' \
--header 'Bold-API-Version-Date: 2022-05-01'
Endpoints that can return multiple resources will return pagination elements with the following attributes:
Attribute | Type | Description |
---|---|---|
total | int | Total number of results available |
count | int | Number of results returned |
per_page | int | Maximum number of results per page |
current_page | int | Current page index |
total_pages | int | Total number of pages available |
next_url | string | URL to fetch next page of results |
previous_url | string | URL to fetch previous page of results |