Developers

Search the docs

Search guides and headings.

Pagination and filters

Page through lists with page and size, and narrow them with single-word filters.

View as Markdown

You will page through any list and narrow it with filters.

Parameters#

Every list route takes page and size.

ParameterDefaultRule
page1From 1.
size10From 1 to 50.

The answer#

json
{
	"data": [
		{ "vendor_id": "vendor-0001", "vendor_name": "Green Table Kitchen" }
	],
	"total_pages": 3,
	"total": 25,
	"page": 1,
	"size": 10,
	"has_next": true,
	"has_previous": false
}

data holds the items (trimmed here). The other fields describe the page. Stop when has_next is false.

Walk every page#

bash
curl "https://api.dev.nurishd.ca/meals/v1/vendor/query/documents?page=2&size=50" \
  -H "X-Partner-API-Key: $NURISHD_API_KEY"

Filters#

Filters are single words in the query string, such as name, type, status, from and to. Each route lists its own. Filter values are the internal values of the resource, for example type=Meal or status=meeting_cancelled. Check the spelling and the values against the API reference.

RouteFilters
GET /meals/v1/vendor/query/documentsname
GET /meals/v1/vendor/{vendor_id}/menu/query/documentsstatus
GET /meals/v1/vendor/{vendor_id}/product/query/documentsname, type, collection, tag
GET /meals/v1/zone/query/documentscity, state, country (required), vendor
GET /developer/v1/event/query/documentstype, from, to

A filter with a bad value answers 422 validation_error. Combine filters freely.

Next#