Skip to content

Auto generated schema based QUERY FOR GET API

Table structure

customer_id first_name last_name last_update pincode isActive
1 Bob lin 2022-11-14 04: 34: 58 382345 1
2 Alice Page 2022-10-15 02: 10: 40 382346 1
3 Mallory Brown 2022-09-13 03: 44: 05 382347 1
4 Eve Mathly 2022-11-12 01: 59: 33 382348 1
5 Eve Page 2022-11-12 01: 59: 33 382349 1

Request Method: POST

  • The query for get data API supports to find, sort, skip, limit, select, deep, getTotalCount, groupBy

URL

/api/schema/user-path/instance/database/table/query
- Here we have all pre-defined supported keys.

Request Payload

{
    "find": {
        "owner_id": {
            "$in": [1, 2, 3]
        }
    },
    "skip": 1,
    "limit": 4,
    "sort": "price",
    "select": "name, owner_id, id, price",
    "deep": [
        {
            "s_key": "owner_id",
            "t_instance": "mysql",
            "t_db": "inventory",
            "t_col": "customers",
            "t_key": "customer_id",
            "find": {
                "first_name": "Billy"
            },
            "isMultiple": true,
            "limit": 10,
            "select": "customer_id,first_name",
            "skip": 2,
            "sort": "first_name"
        }
    ],
    "getTotalCount": true,
    "groupBy": "name"
}

Provide deep information in schema

URL

/api/schema/user-path/instance/database/table/query
- Set instance, database, collection, and column in schema of the collection and provide only 's_key'(source key) in the deep to get deep data.

Request Payload

{
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

provide deep information in schema with flat structure

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "deep": [
        {
            "s_key": "owner_id"
        },
        {
            "s_key": "owner_id.shipping_id"
        }
    ]
}

Circular dependency, flat structure

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "select": "owner_id",
    "deep": [
        {
            "s_key": "owner_id",
            "t_col": "customers",
            "t_key": "customer_id",
            "select": "customer_id"
        },
        {
            "s_key": "owner_id.customer_id",
            "t_col": "products",
            "t_key": "owner_id",
            "select": "owner_id"
        },
        {
            "s_key": "owner_id.customer_id.owner_id",
            "t_col": "customers",
            "t_key": "customer_id",
            "select": "customer_id"
        },
        {
            "s_key": "owner_id.customer_id.owner_id.customer_id",
            "t_col": "products",
            "t_key": "owner_id",
            "select": "owner_id"
        }
    ]
}

Circular dependency

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "deep": [
        {
            "s_key": "owner_id",
            "t_col": "customers",
            "t_key": "customer_id",
            "deep": [
                {
                    "s_key": "customer_id",
                    "t_col": "products",
                    "t_key": "owner_id",
                    "select": "owner_id",
                    "deep": [
                        {
                            "s_key": "owner_id",
                            "t_col": "customers",
                            "t_key": "customer_id",
                            "select": "customer_id"
                        }
                    ]
                }
            ]
        }
    ]
}

Deep inheritance

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "deep": [
        {
            "s_key": "price",
            "t_col": "orders",
            "t_key": "total",
            "select": "pincode",
            "deep": [
                {
                    "s_key": "shipping_id",
                    "t_col": "customers",
                    "t_key": "shipping_id",
                    "select": "phone"
                },
                {
                    "s_key": "shipping_id.pincode",
                    "t_col": "orders",
                    "t_key": "pincode"
                }
            ]
        }
    ]
}

$lt operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$lt": 2
        }
    }
}

$gt operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$gt": 2
        }
    }
}

$lte operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$lte": 2
        }
    }
}

$gte operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$gte": 2
        }
    }
}

$eq operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$eq": 2
        }
    }
}

$ne operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$ne": 2
        }
    }
}

$not operator

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id": {
            "$not": {
                "$in": [1, 2, 3, 4, 5, 6, 7, 8, 9]
            }
        }
    }
}

$and operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "$and": [
            {
                "customer_id": 1
            },
            {
                "pincode": 382345
            }
        ]
    }
}

$or operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "$or": [
            {
                "customer_id": 1
            },
            {
                "pincode": 382345
            }
        ]
    }
}

$nin operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": {
            "$nin": [2, 3, 4]
        }
    }
}

$in operation

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id": {
            "$in": [1, 2]
        }
    }
}

$in operation with empty array

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id": {
            "$in": []
        }
    }
}

$like operation in Custom api

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "first_name": {
            "$like": "Bob%"
        }
    }
}

MongoDB $and operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "$and": [
            {
                "owner_id.customer_id": 1
            },
            {
                "price": 42187
            }
        ]
    }
}

MongoDB $or operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "$or": [
            {
                "owner_id.customer_id": 1
            },
            {
                "price": 42187
            }
        ]
    }
}

MongoDB $in operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$in": [9, 7]
        }
    }
}

MongoDB $nin operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$nin": [2, 4, 6, 8]
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $eq operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$eq": 6
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $ne operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$ne": 1
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $gt operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$gt": 1
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $gte operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$gte": 1
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $lt operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$lt": 1
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB $lte operator in nested find

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "owner_id.customer_id": {
            "$lte": 1
        }
    },
    "deep": [
        {
            "s_key": "owner_id"
        }
    ]
}

MongoDB Give string value in number field

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "customer_id": "7"
    }
}

$regex support

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "first_name": {
            "$regex": "Sie%"
        }
    }
}

$like support

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "find": {
        "first_name": {
            "$like": "Sie%"
        }
    }
}

Deep populate from two tables at a time.

URL

/api/schema/user-path/instance/database/table/query
Request Payload
{
    "deep": [
        {
            "s_key": "customer_id",
            "t_key": "customer_id",
            "t_col": "customers",
            "isMultiple": true,
            "select": "first_name, customer_id",
            "find": {
                "first_name": {
                    "$in": ["Bob"]
                }
            }
        },
        {
            "s_key": "customer_id",
            "t_key": "id",
            "t_col": "products",
            "isMultiple": true,
            "select": "name,id"
        }
    ]
}

Supported headers

Header Description
x-am-response-case It will change the response keys text as requested case.
"x-am-response-case": "camelCase"
noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
x-am-response-object-type To get flat response we use this request header.
"x-am-response-object-type": "make_flat"
no_action | make_flat
x-am-meta To get the meta-data of requested API.
"x-am-meta": "true"
false | true
x-am-secret Place secret id from API Maker.
"x-am-secret": "6381b80359bdbd3a87c9abd5"
x-am-internationalization We can get backend error messages in any user language and directly show them to the user in UI, so the user can take appropriate actions.
Provide saved internationalization name in request header.
"x-am-internationalization": "HINDI"
x-am-run-in-sandbox System will try to run requests in maximum provided sandbox, so if 1 provided every request will run in one sandbox, even if we have multiple sandbox with multiple API Maker instances.
"x-am-run-in-sandbox": "0"
x-am-content-type-response We can provide response type in request header. As provided header value we can expect the response type.
"x-am-content-type-response": "application/json"
application/json | text/xml | text/yaml
x-am-cache-control To reset the cache of the requested API manually and get fresh data, we can use 'x-am-cache-control' request header.
"x-am-cache-control": "reset_cache"
no_action | reset_cache
x-am-get-encrypted-data Encrypt response data and get in to the response.
"x-am-get-encrypted-data": "get_data_and_encryption"
no_encryption | get_only_encryption | get_data_and_encryption
x-am-authorization Provide token of API user in "x-am-authorization" header which will be generated from API Users inside API Maker.
"x-am-authorization": "eyJhbGciOiJIUzI1NiIsdlRrblJlcS"
x-am-user-authorization User token should be provided in 'x-am-user-authorization' header which will be generated based on some database user if required.
"x-am-user-authorization": "eyJhbGciOiJIpc1BydlRrblJlcS"
x-aws-authorization Provide AWS Cognito token in request header 'x-aws-authorization', if required.
"x-aws-authorization": "eyJhbGciOiJIUc1BdlRrlJlcS"
x-google-authorization Provide Google user token in request header 'x-google-authorization', if required.
"x-google-authorization": "eyJhbGceyJpc1BdlRrlJlcS"
x-azure-authorization Provide Azure active directory token in request header 'x-azure-authorization', if required.
"x-azure-authorization": "eyJhbGciOiJIUzI1NiIJpc1BdlRrlJlcS"
x-no-compression If user do not send 'x-no-compression' in request header, and response characters are more than value of "maxCharsResToCache" than the response will be compressed.
"x-no-compression": "true"
x-am-sandbox-timeout If any API did not give a response within given time, the sandbox will break and give a proper error message in the response.
"x-am-sandbox-timeout": "13000"  // milliseconds
x-am-encrypted-payload When user sent encrypted payload, user must have to sent "x-am-encrypted-payload:true".
"x-am-encrypted-payload": "true"