Query Parameters

Query Parameters

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
  1. *
Get all top-level fields and all second-level relational fields
  1. *.*

Get all top-level fields and second-level relational fields within images
  1. *,images.*

Get only the first_name and last_name fields
  1. first_name,last_name

Get all top-level and second-level relational fields, and third-level fields within images.thumbnails
  1. *.*,images.thumbnails.*

Usage

  1. ?fields=title,body,featured_image.*

  2. // or

  3. ?fields[]=title
  4. &fields[]=body
  5. &fields[]=featured_image.*

Filter

Used to search items in a collection that matches the filter's conditions.

Examples

Retrieve all items where first_name equals "Rijk"
  1. {
  2. "first_name": {
  3. "_eq": "Rijk"
  4. }
  5. }
Retrieve all items in one of the following categories: "vegetables", "fruit"
  1. {
  2. "categories": {
  3. "_in": ["vegetables", "fruit"]
  4. }
  5. }
Retrieve all items that are published between two dates
  1. {
  2. "date_published": {
  3. "_between": ["2021-01-24", "2021-02-23"]
  4. }
  5. }
Retrieve all items where the author's "vip" flag is true
  1. {
  2. "author": {
  3. "vip": {
  4. "_eq": true
  5. }
  6. }
  7. }


Usage

  1. ?filter[first_name][_eq]=Rijk

  2. // or

  3. ?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
  1. -date_created

Sort by a "sort" field, followed by publish date descending
  1. sort, -publish_date

Sort by a "sort" field, followed by a nested author's name
  1. sort, -author.name

Limit

Set the maximum number of items that will be returned. The default limit is set to 100.

Usage

  1. ?limit=200


Offset

Skip the first n items in the response. Can be used for pagination.

Usage

  1. ?offset=100



    • Related Articles

    • Items

      Items are individual pieces of data in your database. The Item Object Items don't have a predefined schema. The format depends completely on the fields it has, an item is the equivalent of a row in a table. { "id": 1, "status": "published", "title": ...
    • Authentication

      Access Tokens Temporary Token (JWT) are returned by the login endpoint/mutation. These tokens have a relatively short expiration time, and are thus the most secure option to use. The tokens are returned with a refresh_token that can be used to ...