Skip to content
Logo

API Description

API Description

The client interacts with the server in Abris through the JSON-RPC 2.0 protocol, however, the request format is somewhat different, namely the absence of the id property, both in the request and in the response.

Requests sent to the server must contain two required properties:

  • method - a string with the name of the called method;

  • params - an array of data that should be passed to the method as parameters.

The id property used to map the request to the response is not required.

Responses received from the server should contain the following properties:

  • result - data returned by the method.If an error occurred during the execution of the method, this property should be set to "null";

  • error - error code if an error occurred during the execution of the method, otherwise null.

The id property --- the same value as in the request to which this answer belongs - is missing.

Menu request

  1. The request for receiving menu items is carried out using the method ("method" field) getTableDataPredicate.

The following is indicated as parameters (field "params"):

[{"entityName": "a", "schemaName": "b", "predicate": null, "limit": null, "offset": 0, "order": [{"field": "path", "desc": false}], "where": ""}]

Instead of a and b, enter:

  • instead of "a" - you must specify the name of the entity in the database;

  • instead of "b" - indicate the name of the scheme.

If the request was successful, the server will send the following data in response:

  • error - error code with the value "null";

  • jsonrpc - protocol version with the value "2.0";

  • result - data returned by the method:

    • data - directly a list of menu items and sub-items, each of which contains:

      • iconclass - name of the icon, if any;

      • key - key (if available);

      • name - the full name of the menu item in the database;

      • parent - parent menu item, if any;

      • path - path to the menu item (including all parent items);

      • projection - a short name of the element in the database;

      • title - the title of the menu item as it appears to the user;

      • view_id - data display format indicated by the menu item;

    • offset - offset of records, when querying for lines not from the first line;

    • records - displays the number of records, namely all menu items, including sub-items;

    • sql - SQL query to the database;

  • usename - user login if authorization has been made.

Metadata Request

  1. The request for metadata is carried out using the method (field "method") getAllModelMetadata.

The following is indicated as parameters (field "params"):

    [{}]

If the request was successful, the server will send the following data in response:

  • error - error code with the value "null";

  • jsonrpc - protocol version with the value "2.0";

  • result - data returned by the method:

    • pages - page layout on blocks and subblocks (if any);

    • projections - directly a list of projections in the system available to the user, as well as their metadata (for example, the fields contained in them and their type).

  • usename - user login if authorization has been made.

Query data tables

  1. The request for receiving the table data is carried out using the method (field "method") getTableDataPredicate.

The following is indicated as parameters (field "params"):

  • entityName - table name

  • schemaName - schema name

  • aggregate - block for specifying aggregate functions

  • limit - sample size

  • offset - the number of the record from which to start sampling

  • primaryKey - field name - primary key

  • currentKey - the current value of the primary key.It can be omitted, but if it is set, then the offset parameter is ignored and the data page that has a record with the specified value will be returned

  • join - tables to be joined to the query results.For each table is indicated:

    • schema-schemaname
    • entity- table name
    • key- field of the main table by which we connect
    • entityKey- join table field
    • table_alias- an alias that is assigned to the joined table
    • parent_table_alias- alias of the main table
    • virtual- sign if a virtual table field is attached
  • fields - fields to load.For each field is determined:

    • table_alias- alias of the table this field belongs to
    • subfields- fields of the table associated with this field that should be displayed instead of it (if the field is a foreign key)
    • subfields_table_alias- corresponding subfields table aliases
    • subfields_navigate_alias- alias of the base table
    • subfields_key- key of the base table
  • predicate - predicate

    • operands- operands
    • levelup- used for multi-level conditions
    • field- field
    • path- ignored
    • op- operator (https://abris.site:8090/abris-lab/abris/wikis/tasks/Filtering-the-displayed-data)
    • value- second operand
    • search_in_key- search data also in key
    • table_alias- an alias of the table in which the field is located
    • strict- true if operands are connected by AND
[{"entityName": "ticket_flights", "schemaName": "bookings", "predicate": {"strict": true, "operands": [{"levelup": false, "operand": {"field": "fare_conditions", "path": ["fare_conditions"], "op": "EQ", "value": "Economy", "search_in_key": false, "table_alias": "t"}}, {"levelup" : false, "operand": {"field": "amount", "path": ["amount"], "op": "G", "value": "25000", "search_in_key": false, "table_alias ":" t "}}]}," aggregate ": [{" func ":" avg "," field ":" amount "}]," limit ":" 10 "," offset ": 20," primaryKey ":" ticket_no "," currentKey ":" "," fields ": {" ticket_no ": {" table_alias ":" t "," subfields ": null," hidden ": false}," flight_id ": {" table_alias ":" t "," subfields ": [" flight_no "," airport_code "]," subfields_navigate_alias ":" t0 "," subfields_table_alias ": [" t0 "," t1 "]," subfields_key ":" flight_id " }, "fare_conditions": {"table_alias": "t"}, "amount": {"table_alias": "t"}}, "join": [{"key": "flight_id", "virtual": false , "schema": "bookings", "entity": "flights "," table_alias ":" t0 "," parent_table_alias ":" t "," entityKey ":" flight_id "}, {" key ":" departure_airport "," virtual ": false," schema ":" bookings " , "entity": "airports_data", "table_alias": "t1", "parent_table_alias": "t0", "entityKey": "airport_code"}], "order": [], "process": null, "functions ": []," format ":" array "," desc ":" Loading the table \ "Flight segment \" "}]

If the request was successful, the server will send the following data in response:

{"jsonrpc": "2.0", "result": {"data": [["0005433805700", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ " } "," Economy "," 62100.00 "], [" 0005433763343 "," {\ "f1 \": \ "PG0356 LED \", \ "f2 \": \ "9348 \"} "," Economy ", "62100.00"], ["0005434171107", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"], [" 0005433785282 "," {\ "f1 \": \ "PG0356 LED \", \ "f2 \": \ "9348 \"} "," Economy "," 62100.00 "], [" 0005433785263 "," {\ " f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"], ["0005433763347", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"], ["0005433805688", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"], ["0005434171043", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"], ["0005433763334", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy" , "62100.00"], ["0005433805706", "{\" f1 \ ": \" PG0356 LED \ ", \" f2 \ ": \" 9348 \ "}", "Economy", "62100.00"]], "records": [{"count": "161039"}], "offset": 20, "fields": ["ticket_no", "flight_id "," fare_conditions "," amount "]," sql ":" SELECT \ "t \". \ "ticket_no \", (row_to_json (row (COALESCE (t0. \ "flight_no \" :: text, '' ) || '' ||COALESCE (t1. \ "Airport_code \" :: text, ''), t0. \ "Flight_id \" :: text)) :: text) collate \ "C \" as \ "flight_id \", \ "t \ ". \" fare_conditions \ ", \" t \ ". \" amount \ "FROM \" bookings \ ". \" ticket_flights \ "as t left join \" bookings \ ". \" flights \ "as \" t0 \ "on \" t \ ". \" flight_id \ "= \" t0 \ ". \" flight_id \ "left join \" bookings \ ". \" airports_data \ "as \" t1 \ "on \" t0 \ ". \" departure_airport \ "= \" t1 \ ". \" airport_code \ "where (\" t \ ". \" fare_conditions \ "= 'Economy') AND (\" t \ ". \" amount \ " > '25000') LIMIT 10 OFFSET 20 "," avg (amount) ": [{" avg ":" 40528.439073764740 "}]}," error ": null," usename ":" "," pids ": 0}
  • error - error code with the value "null";

  • jsonrpc - protocol version with the value "2.0";

  • result - data returned by the method:

    • data - directly a list of table entries;

    • offset - offset of records, when querying for lines not from the first line;

    • records - displays the number of table entries;

    • sql - SQL query to the database;

  • usename - user login if authorization has been made.

Detailed form request

  1. A detailed form request is made using the getTableDataPredicate method.

If the request was successful, the server will send the following data in response:

  • error - error code with the value "null";

  • jsonrpc - protocol version with the value "2.0";

  • result - data returned by the method:

    • data - the specified record in the table (all fields and their values);

    • offset - offset of records, when querying for lines not from the first line;

    • records - displays the number of table entries;

    • sql - SQL query to the database;

  • usename - user login if authorization has been made.