Fetching single items
Use the Prepr REST API to fetch a single content item when you need to get specific content for a bulk process. For example, to get content from linked content items as part of a project to migrate content from a legacy system to Prepr CMS.
Use GraphQL API for content delivery
If you simply want to fetch a content item for content delivery then we strongly recommend using the GraphQL API instead.
Before calling a REST API endpoint to fetch a single content item, go to Settings → Access tokens to create an access token with the REST API scope content_items
.
To fetch a content item, send a GET
request to the https://cdn.prepr.io/content_items
endpoint. There are two ways to fetch a single content item.
Query by Id
Since Ids are unique in Prepr, you will be able to find the content item you want using the id
argument.
Here is an example that shows how to query a content item with the Id "535c1e-...".
GET: /content_items/535c1e-4d52-4794-9136-71e28f2ce4c1
Query by Slug
Since slugs are unique within a content model, you will be able to find a content item you want using the slug
argument.
Here is an example that shows how to query a Page type content item with the slug "nieuws/...".
GET: /content_items?slug[0][eq]=nieuws/388107-beelden-paaseiland-wandelden-over-het-eiland.html
Was this article helpful?
We’d love to learn from your feedback