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:
Operator | SQL Equivalent | Description |
---|---|---|
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 |
like | LIKE | Field data should match a pattern |
not_like | NOT LIKE | Field data should not match a pattern |
in | IN | Field data should be in a list of values |
not_in | NOT IN | Field data should not be in a list of values |
null | IS NULL | Field data should be null |
not_null | IS NOT NULL | Field data should not be null |
search | SEARCH | Field data should match a full-text search query |
Sorting
format is sort={column}.{direction},column.{direction}
?sort=contactName.asc,custId.desc