Intro
Global parameters can be used to manipulate the responses you get from the Endpoints, most parameters work across all endpoints.
Fields
Choose the fields that are returned in the current dataset. This parameter supports dot notation to request nested relational fields. You can also use a wildcard (*) to include all fields at a specific depth.
Examples
Get all top-level fields
Get all top-level fields and all second-level relational fields
Get all top-level fields and second-level relational fields within images
Get only the first_name and last_name fields
Get all top-level and second-level relational fields, and third-level fields within images.thumbnails
Usage
- ?fields=title,body,featured_image.*
- // or
- ?fields[]=title
- &fields[]=body
- &fields[]=featured_image.*
Used to search items in a collection that matches the filter's conditions.
Examples
Retrieve all items where first_name equals "Rijk"
- {
- "first_name": {
- "_eq": "Rijk"
- }
- }
Retrieve all items in one of the following categories: "vegetables", "fruit"
- {
- "categories": {
- "_in": ["vegetables", "fruit"]
- }
- }
Retrieve all items that are published between two dates
- {
- "date_published": {
- "_between": ["2021-01-24", "2021-02-23"]
- }
- }
Retrieve all items where the author's "vip" flag is true
- {
- "author": {
- "vip": {
- "_eq": true
- }
- }
- }
- ?filter[first_name][_eq]=Rijk
- // or
- ?filter={ "first_name": { "_eq": "Rijk" }}
Sort
What field(s) to sort by. Sorting defaults to ascending, but a minus sign (-) can be used to reverse this to descending order.
Examples
Sort by creation date descending
Sort by a "sort" field, followed by publish date descending
Sort by a "sort" field, followed by a nested author's name