Get Model List

Get list of model records and apply filters

GET https://YOUR_JET_BRIDGE_HOSTNAME/jet_api/models/:model/

Path Parameters

NameTypeDescription

model

string

Unique model name

Query Parameters

NameTypeDescription

FIELD_1

string

Filter records by field value

FIELD_2_LOOKUP

string

Filter records by filed value with different lookup, example: ?name=John ?name__startswith=Jo Read more about lookups on Model Field Types page

_order_by

string

Sort by field, example: "name" - sort by name ascending "-name" -sort by name descending

page

integer

Page to return

_per_page

integer

Items to return per page

_segment

string

Name of SQL segment to apply, contains SQL query in body

_search

string

Search query

_relation

string

Filter by related models with custom JOIN

Headers

NameTypeDescription

Authorization

string

Token authentication, example: Authorization: Token f42a3cab3f146b283701a4e314f1c7ba57fdb59e

{
    // Total number of records
    "count": 2
    // Number of pages
    "num_pages": 1,
    // Records to show per page
    "per_page": 25
    // JSON encoded records
    "results": [
        {
            "id": 2,
            "unique_name": "China",
            "name": "China",
            "alpha_3": "CHN",
            "continent": null,
            "order": 1,
            // (optional) How to display record in interface
            "__str__": "China"
        },
        {
            "id": 1,
            "unique_name": "usa",
            "name": "USA",
            "alpha_3": "USA",
            "continent": 1,
            "order": 2,
            "__str__": "USA"
        }
    ],
    "num_pages": 1,
    "per_page": 25
}

Last updated