GET /api/<entityName>Link

ParametersLink

Name parameter type default value example value
page[number] integer 1 5
page[size] integer 10 100
query json base64 [] [{"column": "name", "operator": "is", "value": "england"}]
group string - [{"column": "name", "order": "desc"}]
included_relations comma separated string - user post author
sort comma seaparated string - created_at amount guest_count
filter string - england

ResponseLink

Response example

{
    "links": {
        "current_page": 1,
        "from": 0,
        "last_page": 1,
        "per_page": 10,
        "to": 10,
        "total": 1
    },
    "data": [{
        "type": "book",
        "id": "29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6",
        "attributes": {
            "__type": "book",
            "confirmed": 0,
            "created_at": "2018-04-05 15:47:29",
            "title": "book title",
            "name": "book name",
            "permission": 127127127,
            "reference_id": "29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6",
            "updated_at": null,
            "user_id": "696c98d3-3b8b-41da-a510-08e6948cf661"
        },
        "relationships": {
            "author_id": {
                "links": {
                    "related": "/api/book/<book-id/author_id",
                    "self": "/api/book/<book-id>/relationships/author_id"
                },
                "data": []
            }
        }
    }]
}

ExamplesLink

Curl exampleLink

curl '/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10' \
  -H 'Authorization: Bearer &lt;AccessToken&gt;'

jQuery ajax exampleLink

$.ajax({
    method: "GET",
    url: '/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10',
    success: function(response){
        console.log(response.data);
    }
  })

Node js exampleLink

var request = require('request');

var headers = {
    'Authorization': 'Bearer &lt;AccessToken&gt;'
};

var options = {
    url: '/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10',
    headers: headers
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Python exampleLink

import requests

headers = {
    'Authorization': 'Bearer &lt;AccessToken&gt;',
}

params = (
    ('sort', '-created_at'),
    ('page[number]', '1'),
    ('page[size]', '10'),
)

response = requests.get('http://api.daptin.com:6336/api/laptop', headers=headers, params=params)

PHP exampleLink

&lt;?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
    'Authorization' =&gt; 'Bearer &lt;AccessToken&gt;'
);
$response = Requests::get('http://api.daptin.com:6336/api/laptop?sort=&amp;page[number]=1&amp;page[size]=10', $headers);

FilteringLink

Used to search items in a table that matche the filter's conditions. Filters follow the syntax query=[{"column": "<column_name>", "operator": "<compare-operator>", "value":"<value>"}]

Daptin operator SQL compare operator
contains like '%\'
not contains not like '%\'
is =
is not !=
before <
less then <
after >
more then >
any of in
none of not in
is empty is null
is not empty is not null

ExampleLink

curl '/api/world?query=[{"column": "is_hidden", "operator": "any of", "value":"1,0"}] \
  -H 'Authorization: Bearer &lt;AccessToken&gt;'