List the items of a content type
Returns the published items of a content type you defined in the Console, such as faq or store-locations. It is the older, simpler route: it has no paging, no sorting and no language.
| Method | Path |
|---|---|
GET | /v1/public/cms/:contentTypeSlug/items |
:contentTypeSlug is the slug of the content type.
Who can call it
A CMS API key, or a signed-in user of the tenant. This route is never open: naming the tenant is not enough. See who can read content.
Request
curl --get 'https://api.sandbox.ovok.com/v1/public/cms/faq/items' \
--header "x-api-key: ${OVOK_CMS_KEY}" \
--data-urlencode 'tenant=big-health-company'
| Query | Description |
|---|---|
tenant, projectId, environment, apiKey | As for listing a collection. |
locale, page, limit and sort are not read on this route.
Response
The same list envelope as for a collection (docs, totalDocs, limit, totalPages, page and the paging links). Each item has:
| Field | Meaning |
|---|---|
contentType | The content type the item belongs to. |
title | The item's title. |
slug | The item's slug, unique within your tenant and environment. |
status | Always published here. |
data | The values of the fields you defined for the content type, as JSON, keyed by each field's key. |
What can go wrong
The errors in the overview apply. An open collection route would let a name-only request through; this one answers 401 without a key or session.
Gotchas
- At most 100 items, silently. There is no paging. If you have more, the first 100 come back, and
hasNextPagecan betruewith no way to reach the rest. Keep each content type under 100 published items, or define more than one. - No language.
localeis ignored. If you need localised content, use a collection with localised fields. - No shared content. Ovok's shared tenant is not merged in, and there is no slug fallback.
- The slug is not checked. An unknown content type is not rejected as such: you simply get no items.
- It is cached separately from the collection routes, with the same 60-second window.