Building Requests

Fields

You can specify which fields you would like to return, defaults to *

Example ?fields=orderId,shipName,Customer.ContactName

Relations

You can fetch deeper content by passing relations, assuming their is a foreign key connection it will return the deep result.

Example ?relations=Customer

Warning: In our attempt to keep the relations implementation simple we will always return an array, this simplifies your implementation as you don't need to check if it's an object or array.

Pagination

Pass &page= into subsequent requests to load a specific page results, or alternatively use the limit and offset values directly:

"pagination": {
        "total": number, //total results in this page
        "page": {
            "current": string, //the page ref for the current page
            "prev": string, //the page ref for the previous page (if applicable)
            "next": string, //the page ref for the next page (if applicable)
            "first": string,
            "last": string
        }
    },

Filtering

Filter results by passing query parameters like column[operator]=value

Example: ?city=Barcelona or ?city[equals]=Barcelona

Operators are:

OperatorSQL EquivalentDescription
equals=Field data should match input value
not_equals!=Field data should not match input value
lt<The value is less than the input value
lte<=The value is less than or equal to the input value
gt>The value is greater than the input value
gte>=The value is greater than or equal to the input value
likeLIKEField data should match a pattern
not_likeNOT LIKEField data should not match a pattern
inINField data should be in a list of values
not_inNOT INField data should not be in a list of values
nullIS NULLField data should be null
not_nullIS NOT NULLField data should not be null
searchSEARCHField data should match a full-text search query

Sorting

format is sort={column}.{direction},column.{direction}

?sort=contactName.asc,custId.desc