Filtering
To efficiently retrieve objects, the Plate API supports two filtering methods:
- Filtering by ID (
id[]): Fetch multiple known records by their IDs in a single request - Filtering by content (
content): Search for objects based on specific content field values
Both methods allow you to retrieve multiple records in a single request—rather than sending multiple requests.
Filtering by id
To filter by ID, add the id[] query parameter for each object you want to retrieve.
Example
To retrieve posts with IDs 1, 5, and 6:
GET {base_url}/site_translations/12/posts?id[]=1&id[]=5&id[]=6
This request will return all matching posts in a single response.
Supported Resources
Filtering by id[] is currently supported on the following index endpoints:
- Site Translations
- Posts
- Sections
- Elements
- Content Objects
- Authentication Objects
Filtering by content
You can filter objects by their content field values using the content parameter. This allows you to search for objects based on specific content field values.
Example
To filter posts by content field values, specify a content_type_id and one or more content:
GET {base_url}/site_translations/12/posts
?content_type_id[]=1&content[header_title]=Getting Started
GET {base_url}/site_translations/12/posts
?content_type_id[]=1
&content[categories][]=technology
&content[categories][]=programming
Note: Filtering by reference-type content fields (fields that reference other content objects) is not currently supported
Warning: Using a content field name (e.g.,
categories,header_title) that doesn't belong to the specified content type will result in a 400 Bad Request error.
Supported Resources
Filtering by content is currently supported on the following index endpoints:
- Posts
- Sections
- Elements
- Content Objects