System REST Endpoints

You can retrieve information about an API, such as the list of entities and resources and their attributes, rather than actual data, using the system REST endpoints that  provides.  provides these endpoints as metadata services.
lac42
You can retrieve information about an API, such as the list of entities and resources and their attributes, rather than actual data, using the system REST endpoints that 
Layer7 Live API Creator
 provides. 
Layer7 Live API Creator
 provides these endpoints as metadata services.
Prerequisite: 
You have access to meta table REST endpoints.
For more information about how to grant roles permissions to meta table REST endpoints, see Authorization and Role-Based Endpoint Access.
This article includes examples. These examples assume that you are sending an authentication token with the request, either in the URL (with the 
auth
 parameter) or, more commonly, in the 
Authorization
 header.
In this article:
 
23
@apioptions
GET @apioptions
You can retrieve a list of the API-specific settings–for example, the default page size, support for HTTPS, the encoding formats, the XML root, the metadata tag name–for the current API using the 
@apioptions
 system REST endpoint: 
GET @apioptions
URL
 
GET https://api.acme.com/rest/default/myproj/v1/@apioptions
Response
 
The following response is expected:
"1": {
"ident": 1,
"name": "Aggregate Default Override",
"description": "Controls whether setting/altering aggregates is overridden (default), or raises an exception.",
"option_value": "false",
"data_type": "boolean",
"default_value": "false",
"valid_value": null
},
"2": {
"ident": 2,
"name": "Type base URI",
"description": "The base URI for the types of relationships",
"option_value": "urn:caliveapicreator:examples:demo:",
"data_type": "string",
"default_value": "urn:caliveapicreator:",
"valid_value": null
},
"3": {
"ident": 3,
"name": "HTTPS only",
"description": "Whether only HTTPS can be used to communicate with this project.",
"option_value": "false",
"data_type": "boolean",
"default_value": "false",
"valid_value": null
},..etc...
The key for examples 1 through 3 is the ID of the option type (the name is the human-readable equivalent).
@apps
GET @apps[/appid]
You can retrieve a list of the applications and definitions (table settings and skins) defined in Data Explorer for the 
appid
 that you identify using the 
@apps
 system REST endpoint:
GET @apps[/appid]
Response
 
The following response is expected:
{
"ident": 14,
"name": "Default app",
"description": null,
"default_language": "eng",
"skin": null,
"tableSettings": {
"demo:PurchaseOrder": {
"tableAlias": null,
"tableDesc": null,
"json": "{\"name\":\"demo:PurchaseOrder\",\"alias\":\"demo:PurchaseOrder\",\"columnFormats\":{\"order_number\":{\"name\":\...}
}
}
@auth_provider_info
GET @auth_provider_info[/ident]
You can retrieve the detail configuration values for this plugin identity manager using the 
@auth_provider_info
 system REST endpoint, passing in the 
ident
 of a specific authentication provider:
GET @auth_provider_info[/ident]
@authentication
POST @authentication
Prerequisite:
 You have specified the 
built-in authentication
 authentication provider or a custom JavaScript authentication provider as the authentication provider for your API.
You can authenticate an API user and obtain an authentication token using the 
@authentication
 system REST endpoint and the following payload:
POST @authentication
You can use this authentication token with every request to API Server. The request passes API Server the credentials (for example, user and login) and returns the list of roles it uses for authorization.
Payload
 
Use a request payload similar to the following:
{
"username": "<the API user's username>",
"password": "<the API user's password>"
}
Response:
 
A response similar to the following is expected:
{
"apikey": "<the generated authentication token>"
"expiration": <the authentication token's expiration date>"
"email": "<the API user's email address>"
}
@columns
POST @columns/[prefix]:[table name]?projectId=[
123
]
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
    For more information about this role, including all of the roles for creating databases and managing tables and fields, see Database Creation.
  • The data source for the table for which you want to create a field is marked as editable.
    For more information about how to mark a data source as editable, see Manage Existing Schemas.
You can create a field in an existing table in the data source using the 
@columns
 system REST endpoint:
POST @columns/[prefix]:[table name]?projectId=[123]
Use the prefix and table name to know which database the original table was defined. The valid generic_types are (string, text, int, decimal, number, date, datetime).
Fields represent the columns in your database. The term field is used to stay within the metaphor of applications and screens, and not database terminology.
Payload
 
Use a request payload similar to the following:
{
"generic_type":"text",
"name":"
mynewcolumn_text
",
"size":16777216,
"nullable":true
}
PUT @columns/[prefix]:[table name]/[column name]?projectId=[123]
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
  • The data source for the table for which you want to modify a field is marked as editable.
You can modify a field in an existing table in the data source using the 
@columns
 system REST endpoint:
PUT @columns/[prefix]:[table name]/[field name]?projectId=[123]
Fields represent the columns in your database. The term field is used to stay within the metaphor of applications and screens, and not database terminology.
Payload
 
Use a request payload similar to the following:
{ "name": "[
new_field_name]
", }
DELETE @columns/[prefix]:[table name]/[field name]?projectId=[
123
]
You can delete a field in an existing table in the data source using the 
@columns
 system REST endpoint:
DELETE @columns/[prefix]:[table name]/[field name]?projectId=[123]
Fields represent the columns in your database. The term field is used to stay within the metaphor of applications and screens, and not database terminology.
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
  • The data source is marked as editable.
@data_sources
GET @data_sources
You can retrieve a list of active data sources for the current API using the 
@data_sources
 system REST endpoint:
GET @data_sources
Only authentication tokens that have a role with a permission for the 
@metatables
 pseudo-table can call this endpoint.
Response
 
The following response is expected:
[ { "name": "Finance", "ident": 2009, "prefix": "finance", "comments": null, "schema_editable": false }, { "name": "New database qjtea", "ident": 2159, "prefix": "qjtea", "comments": null, "schema_editable": true } ]
@databases
GET @databases?managed_data_server_ident=12345
You can retrieve the list of managed databases existing on a managed data server using the 
@databases
 system REST endpoint:
GET @databases?managed_data_server_ident=12345
Prerequisites:
 
  • You have an existing managed data server.
  • You are logged in to API Creator with the Data designer role.
Response
 
The following response is expected:
{
"status": "OK",
"number_databases": 2,
"databases": [
{
"database_name": "bsfst",
"number_objects": "47"
},
{
"database_name": "cpkub",
"number_objects": "6"
}
]
}
Each entry reflects a database/schema in the server. The 
number_objects
 attribute shows the approximate number of tables and views in the database. This is meant to be a rough indication of the size of the database.
POST @databases
You can create a new SQL database and get information about the database using the 
@databases
 system REST endpoint and passing the 
ident
 value of the specific server:
POST @databases
Payload
 
Use a request payload similar to the following:
{
"managed_data_server_ident": 2000
}
Prerequisites:
 
  • You have an existing managed data server.
  • You are logged in to API Creator with the Data designer role.
Response
 
The following response is expected:
{ "status": "OK", "url": "jdbc:mysql://dbserver.acme.com:3306/wcwqj", "name": "wcwqj", "catalog_name": null, "schema_name": "wcwqj", "user_name": "wcwqj", "password": "IotMPl14w0zx", "dbasetype_ident": 1 }
You can create a new data source (DBSchema) using this information.
DELETE @databases/[databasename]?managed_data_server_ident=[2000]
Prerequisite:
 You are logged in to API Creator with the Data designer role.
You can delete a managed database using the 
@databases
 system REST endpoint and passing in the database name and the managed server 
ident
 value:
DELETE @databases/databasename?managed_data_server_ident=2000
@dependencies
GET @dependencies
You can retrieve dependencies information using the 
@dependencies
 system REST endpoint:
GET @dependencies
Response
 
The following response is expected:
[{ "tableName": "LOGICDEMO."LineItem"", "dependencies": [ { "ruleName": "Discounted price*qty", "columnName": "amount", "dependsOn": "product_price" }, { "ruleName": "Discounted price*qty", "columnName": "amount", "dependsOn": "qty_ordered" }, { "ruleName": "Derive product_price as parentcopy(product.price)", "columnName": "product_price", "roleName": "product", "dependsOn": "price" } }, more... ]
@docs
GET @docs
You can retrieve Swagger documentation about the API using the 
@docs
 system REST endpoint:
GET @docs
For more information about how to retrieve Swagger documentation for your API, see API Docs.
Response
 
The following response is expected:
{ "swaggerVersion": "1.2", "consumes": [ "application/json" ], "produces": [ "application/json" ], "apiVersion": "v1", "info": { "title": "Northwind", "description": "Simple order processing demo" }, "authorizations": { "Admin key": { "type": "apiKey", "passAs": "header", "keyname": "Authorization" } }, "apis": [ { "path": "/CustomersBusObject", "description": "resource" }, { "path": "/EmployeesObject", "description": "resource" }, etc...
@eula
GET @eula[/eula_code]
You can retrieve the End User License Agreement (EULA) in the specified language using the 
@eula
 system REST endpoint:
GET @eula[/eula_code]
URL
 
GET https://api.acme.com/rest/default/demo/v1/@eula/ENU
Response
 
The following response is expected:
"eula_code": "ENU", "eula_accepted": true, "eula_accepted_code": "ENU", "eula_acceptance_detail": "accepted ENU 2016-07-14T18:54:28Z", "eula": "CA End User License Agreement (the "Agreement") ... truncated
POST @eula
You can accept the end-user license agreement using the API using the 
@eula
 system REST endpoint:
POST @eula
Response
 
The following response is expected:
{"eula_accepted": true, "eula_code": "ENU"}
@functions
GET @functions
You can retrieve all functions for the current API using the 
@functions
 system REST endpoint:
GET @functions
A list of function definition objects will result, looking like:
[ { "@metadata": { "href": "http://liveapicreatorurl.com/rest/default/demo/v1/@functions/2004" }, "ident": 2004, "name": "tableResourceParameterizedFunc", "comments": "This is a skeleton function, you should most likely:\n1 - Give it a proper name (the default is a randomly generated 5-letter name)\n2 - Give it a proper comment\n3 - Change the code to do something useful", "is_active": true, "resource_names": [ "AllCustomers", "demo:customer" ], "parameters": [ { "name": "qmzfv", "type": "string", "is_required": false } ] } ]
@heartbeat
GET @heartbeat
You can retrieve API Server status using the 
@heartbeat
 system REST endpoint:
GET @heartbeat
URL
 
GET https://api.acme.com/rest/abl/admin/v2/@heartbeat
Response
 
The following response is expected:
{ "status": "OK"}
If the value of status is anything but 
OK
, then the server is not feeling well. Otherwise, the server is most likely OK.
@license
GET @license
You can retrieve a value that depends on whether the call is authenticated (includes an authentication token) or not using the 
@license
 system REST endpoint:
GET @license
URL
 
GET https://api.acme.com/rest/default/demo/v1/@license
Response
 
If the call is authenticated, the following response is expected:
{ "company": "Acme Corp.", "organization": "Accounting", "location": "New York, NY, USA", "license_type": "PRODUCTION", "license_expiration": "2017-12-31T23:59:59.999Z", "product_version": "2", "max_cores": 8, "max_memory": 1024, "max_projects": 0, "max_requests": 0, "max_resources": 0, "max_rules": 0, "eula": "Lorem ipsum etc..." }
If the call is not authenticated, the following response is expected:
{ "company": "Acme Corp.", "organization": "Accounting", "location": "New York, NY, USA", "license_type": "PRODUCTION", "license_expiration": "2017-12-31T23:59:59.999Z" }
@login_info
GET @login_info
You can create a login dialog by retrieving the default values that the authentication provider uses using the 
@login_info
 system REST endpoint:
GET @login_info
@metatables
GET @metatables
You can retrieve a list of most of the APIs listed on this page using the 
@metatables
 system REST endpoint:
GET @metatables
Response
 
The following response is expected:
[ { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@tables" }, "name": "@tables" }, { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@views" }, "name": "@views" }, { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@procedures" }, "name": "@procedures" }, { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@resources" }, "name": "@resources" } ]
@procedures
GET @procedures
You can retrieve a list of all stored procedures using the 
@procedures
 system REST endpoint:
GET @procedures
The 
procname
 option retrieves details about the stored procedure itself.
URL
 
https://api.acme.com/rest/acme/demo/v1/@procedures?
projectId=[1234]
Response
 
The following response is expected:
[
{
"@metadata": {
"href": "https://api.acme.com/rest/acme/demo/v1/@procedures"
},
"prefix": "[prefix]",
"entity": "[entity]",
"name": "[prefix]:[entity]"
},
{
"@metadata": {
"href": "https://api.acme.com/rest/acme/demo/v1/@procedures/demo:get_employee"
},
"prefix": "demo",
"entity": "get_employee",
"name": "demo:get_employee"
}
]
GET @procedures[/procedure_name]
After you have retrieved the metadata for a stored procedure using the 
@procedures
 endpoint, you can retrieve full information for the stored procedure using the 
@procedures
 system REST endpoint against the URL for that stored procedure:
GET @procedures[/procedure_name]
You can also retrieve metadata on functions and packages using the 
@procedures
 endpoint.
Response
 
The following response is expected:
{
"@metadata": {
"href": "https://api.acme.com/rest/acme/demo/v1/@procedures/[prefix]:[entity]"
},
"prefix": "[prefix]",
"entity": "[entity]",
"name": "demo:get_employee",
"args": [{
"name": "GIVEN_EMPLOYEE_ID",
"type": "NUMERIC",
"generic_type": "number",
"nullable": true,
"db_column_type": "NUMBER",
"subtype": "fixed_point",
"precision": -2147483648,
"scale": null,
"direction": "IN"
},
{
"name": "PLUS_ONE",
"type": "NUMERIC",
"generic_type": "number",
"nullable": true,
"db_column_type": "NUMBER",
"subtype": "fixed_point",
"precision": -2147483648,
"scale": null,
"direction": "IN_OUT"
},
{
"name": "EMP_CURSOR",
"type": null,
"generic_type": "ref cursor",
"scale": 2147483647,
"nullable": true,
"db_column_type": "REF CURSOR",
"direction": "OUT"
},
{
"name": "SALES_CURSOR",
"type": null,
"generic_type": "ref cursor",
"scale": 2147483647,
"nullable": true,
"db_column_type": "REF CURSOR",
"direction": "OUT"
}
]
}
@relationships
POST @relationships/[prefix]:[table name]?projectId=[
123
]
You can create a parent/child relationship using the 
@relationships
 system REST endpoint. Provide the prefix (that belongs to a data source) and the name of the child table using the following syntax:
You must make this call from the 
Layer7 Live API Creator
 Admin project API (Admin API).
For more information about this API, see API Creation by REST.
POST @relationships/[prefix]:[table name]?projectId=[123]
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
  • The data source is marked as editable.
By default, if you do not pass in parent and child column names, 
Layer7 Live API Creator
 creates them automatically using the parent primary key (usually 
ident
) and creates a new field on the child table using the name of the relationship plus the name of the primary key. If you intend to provide the column names, you can override this default behavior using 
enable_column_creation: false
 in the payload.
Payload
 
Use a request payload similar to the following:
{
"parent_entity":"Parent!",
"relationship_name":"FooBar"
}
optional field(s):
enable_column_creation: [true | false] (
default: true)
"enable_column_creation": false,
"child_column_names": [
"FooBar_ident"
],
"parent_column_names": [
"ident"
]
With this payload, 
Layer7 Live API Creator
 attempts to use the column names you provide instead, using a lookup of the attribute names. If the attribute names are incorrect, then an error is returned.
Response
 
The following response is expected:
{ "status": "OK", "child_entity": "uqhee:Child!!", "parent_entity": "uqhee:Parent!", "child_column_names": [ "FooBar_ident" ], "parent_column_names": [ "ident" ], "relationship_name": "FooBar", "children_role_name": "FooBar_Child$0021$0021_List", "parent_role_name": "FooBar_Parent$0021", "constraint_name": "FK_FooBar_$6486$" }
PUT @relationships/[prefix]:[table name]?projectId=[123]
You can update a parent/child relationship using the 
@relationships
 system REST endpoint:
You must make this call from the Admin API.
For more information about this API, see API Creation by REST.
PUT @relationships/[prefix]:[table name]?projectId=[
123]
Payload
 
Use a request payload similar to the following:
{
"parent_entity": "parent_table",
"relationship_name": "new_relationship_name"
}
Response
 
The following response is expected:
{
"status": "OK",
"relationship_name": "new_relationship_name"
}
DELETE @relationships/[prefix]:[table name]/relationshipname?projectId=123
You can remove a relationship between a parent and child table based on the relationships role name using the 
@relationships
 system REST endpoint and providing the table prefix and table name for the table:
You must make this call from the Admin API.
For more information about this API, see API Creation by REST.
DELETE @relationships/[prefix]:[table name]/relationshipname?projectId=123&enableDeleteColumns=true
The relationship role name can be the name to the parent or the name to the child. You can allow API Creator to remove the related foreign key column using the url 
?enableDeleteColumns=true
. By default, this value is set to false and API Creator does not delete columns.
Prerequisite: 
You are logged in to API Creator with the Data designer role.
Response
 
The following response is expected:
{ "status": "OK" }
@resources
GET @resources
You can use similar built-in resources for resources. You can retrieve all resources for the current API using the 
@resource
 system REST endpoint:
GET @resources
You can retrieve full information for a resource using the href URL or retrieve full information for all resources using "*".
URL
 
https://api.acme.com/rest/acme/myproject/v1/@resources
Response
 
The following response is expected. The 
href
 provides a link to retrieve details about the specific resource:
[
{
"@metadata": {
"href": "http://api.acme.com/rest/acme/myproject/v1/@resources/2099"
},
"ident": 2099,
"name": "ProfileAccounts",
"apiVersion": "v1",
"description": null,
"resource_type": "TABLE-BASED"
}
GET @resources[/ident]
You can use similar built-in resources for resources. You can retrieve all resources for the current API using the 
@resource
 system REST endpoint:
{
"ident": 2022,
"apiVersion": "v1",
"name": "AllCustomers",
"prefix": "demo",
"entity": "customer",
"table_name": "customer",
"entity_name": "demo:customer",
"description": "Query for all customers",
"resource_type": "NORMAL",
"is_collection": true,
"join_condition": null,
"filter": null,
"sorting": null,
"extendedProperties": null,
"functions": [
],
"attributes": [
],
"subresources": [
],
"@metadata": {
"href": "http://localhost:8080/APIServer/rest/default/demo_mysql/v1/@resources/2022"
}
}
You can retrieve full information for a resource using the href URL or retrieve full information for all resources using "*".
@rules
GET @rules[/ident]
You can retrieve a high-level list of the rules that are defined for an API using the 
@rules
 system REST endpoint:
GET @rules[/ident]
Response
 
The following response is expected:
[ { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@rules/2000" }, "ident": 2000, "bestName": "Validation return row.Balance <= row.CreditLimit;", "name": "", "entityName": "nw:Customers", "columnName": null, "comments": "Observe Error message insertion points {}" }, { "@metadata": { "href": "https://api.acme.com/rest/default/demo/v1/@rules/2001" }, "ident": 2001, "bestName": "adjust the balance to be the sum(OrdersList.AmountTotal) for unshipped orders", "name": "adjust the balance to be the sum(OrdersList.AmountTotal) for unshipped orders", "entityName": "nw:Customers", "columnName": null, "comments": "Adjusts Balance by *reacting* to changes in OrdersList.AmountTotal, including other changes noted in Table/Column help." }, etc...
@schema
GET @schema/[datasource_prefix]?projectId=123
The 
@schema
 system REST endpoint can represent specific data source content, such as entities, columns, keys, and relationships. You can retrieve a list of a specific data source definition and then use it to import as a new schema by calling the POST 
@schema
 REST endpoint:
GET @schema/[datasource_prefix]?projectId=123
If you use this endpoint in REST Lab, then the 
prefix
 must be for a data source in the current API and the 
projectId
 is optional. If you make this call from an admin endpoint, then the 
projectId
 is required.
Schema Definition
 
Schema is an array of JSON objects for each entity (table) definition. Each table in the schema contains the following:
JSON Object
Description
entity
Entity name
primaryKeyColumns
An array of comma sepaerated column names.
columns
An array of columns in JSON.
Attributes:
 
  •  
    name
     
  •  
    generic_type
    Values:
     
    string
    int
    , binary, 
    boolean
    , interval, 
    number
    date
    datetime
    text, timestamp, or timestamp with time zone
     
  •  
    size
     
  •  
    nullable
     
  •  
    subtype
    Values:
     
    integer
    floating_point
    fixed_point
     (uses 
    precision
     and 
    scale 
    columns), day to second, hour to second, year to month
    Optional:
     Yes
  •  
    db_column_type
    This attribute specifies that you want to import the schema from within the same database type. If you want to port a schema from one database to another, select the 
    Ignore DB Column Type
     option during schema import or specify the parameter 
    ignoredbcolumntype=true
     in the URL.
    Optional:
     Yes
  •  
    precision
    Optional:
     Yes
  •  
    length
    Optional:
     Yes
  •  
    scale
    Optional:
     Yes
  • days
    Optional:
     Yes
  • hours
    Optional:
     Yes
  • minutes
    Optional:
     Yes
  • seconds
    Optional:
     Yes
  • year
    Optional:
     Yes
  • month
    Optional:
     Yes
relationships
An array of relationships in JSON.
Attributes:
 
  •  
    constraint_name (if null - treated as virtual)
     
  •  
    parent_entity
    : Entity name of parent
  •  
    role_to_parent
    : Role name to parent
  •  
    role_to_child
    : Role name to child
  •  
    update_rule
    : R - (Restrict), C - (Cascade), N - (Set Null)
  •  
    delete_rule
    : R - (Restrict), C - (Cascade), N - (Set Null)
  •  
    parent_column_names
    : Array of strings
    Optional:
     Yes
  •  
    child_column_names
    : Array of strings
    Optional: 
    Yes
    To provide the column names, override this default behavior using the 
    enable_column_creation: false|true
     property, which defaults to 
    true
    .
keys
A collection of primary and candidate keys with each containing the following attributes: 
name, type
 (primary|candidate) and 
columns
 (array of string names).
Advanced Options
 
The following properties default to 
false
 if the flag is not present:
  •  
    skiptablecreation = true | 
    false
     
     
    If true, ignore the creation of tables and column and only process relationships
  •  
    skiprelationships = true | 
    false
     
     
    If true, ignore the creation of relationships and only process tables and columns (useful for data import)
  •  
    ignoredbcolumntype = true|
    false
     
    Use 
    generic_type
     and subtype instead of 
    db_column_type
     .
  •  
    ignoreprimarykeyname=true|
    false
     
    Ignore the provided primary key name and generate a new name.
  •  
    ignoreconstraintname=true|
    false
     
     
    Ignore the provided relationship constraint name in parents and generate a new name.
    This property uses the 
    prefix
     of the selected API. This 
    prefix
     must belong to a data source that is marked as editable. You can only call this property using an admin endpoint, for example:
    /rest/abl/admin/v2/@schema
POST @schema/[datasource_prefix]?projectId=123[&advanced options]
You can create a schema using the 
@schema
 system REST endpoint:
POST @schema/[datasource_prefix]?projectId=123[&advanced options]
Prerequisite:
 The 
prefix
 must belong to a data source that is marked as isEditable.
Payload
 
Use a request payload similar to the following:
{
"entity": "PurchaseOrder",
"primaryKeyColumns": [
"order_number"
],
"columns": [
{
"name": "order_number",
"generic_type": "number",
"nullable": false,
"db_column_type": "bigint(20)",
"subtype": "integer",
"num_bytes": 8,
"autonum": true
},
{
"name": "amount_total",
"generic_type": "number",
"size": 19,
"nullable": true,
"db_column_type": "decimal(19,4)",
"subtype": "fixed_point",
"precision": 19,
"scale": 4
},
{
"name": "paid",
"generic_type": "boolean",
"nullable": false,
"db_column_type": "bit(1)"
},
{
"name": "notes",
"generic_type": "string",
"size": 1000,
"nullable": true,
"db_column_type": "varchar(1000)",
"length": 1000,
"fixed_size": false
},
{
"name": "customer_name",
"generic_type": "string",
"size": 50,
"nullable": false,
"db_column_type": "varchar(50)",
"length": 50,
"fixed_size": false
}
],
"parents": [
{
"role_to_parent": "customer",
"role_to_child": "PurchaseOrderList",
"update_rule": "N",
"delete_rule": "C",
"constraint_name": "customer",
"parent_entity": "customer",
"parent_column_names": [
"name"
],
"child_column_names": [
"customer_name"
]
}
],
"keys": [
{
"name": "PRIMARY",
"type": "primary",
"physical_type": "primary",
"columns": [
"order_number"
]
}
]
} .. truncated ...
Response
 
The following response is expected: 
{ "status": 201, "prefix": [datasource_prefix], "number_tables": 7, "number_columns": 35, "number_relationships": 6 }
@sequences
GET @sequences
You can retrieve a list of the database sequences that are being used using the 
@sequences
 system REST endpoint:
GET @sequences
This call returns an empty array except for those databases that support sequences, such as Oracle and Microsoft SQL Server.
@serverinfo
GET @serverinfo
You can retrieve information about the server it reached using the 
@serverinfo
 system REST endpoint:
GET @serverinfo
Response
 
The following response is expected:
{
"publicAddress": "12.34.56.78",
"hostname": "api.acme.com",
"osName": "Linux 2.8",
"currentDateTime": "2015-11-10T01:19:27.539Z",
"numCores": 8,
"freeMemory": 263916512,
"maxMemory": 3817865216,
"totalMemory": 632291328,
"uptime": 621827,
"loadAverage": 2.48974609375,
"adminSchemaVersion": "20151106",
"serverVersion": "2.0"
}
@tables
GET @tables
You can retrieve a list of all database tables in an API using the 
@tables
 system REST endpoint:
GET @tables
The API key in question must have access to the resource in question. For example, if you want to retrieve the list of all tables for an API, your API key must have a role with a permission for the 
@tables
 pseudo-table. You can retrieve full information for a table using the href URL or retrieve full information for all tables using "*".
URL
 
https://server.acme.com/rest/acme/myproject/v1/@tables
Response
 
The following response is expected:
[ { "@metadata": { "href": "https://api.acme.com/rest/acme/myproject/v1/@tables/main:customer" }, "prefix": "main", "entity": "customer", "name": "main:customer" }, { "@metadata": { "href": "https://api.acme.com/rest/acme/myproject/v1/@tables/main:lineitem" }, "prefix": "main", "entity": "lineitem", "name": "main:lineitem" } ]
GET @tables/[
prefix
]:[
tablename
]
After you have retrieved the list of tables in an API using the 
@tables
 system REST endpoint, you can retrieve information for a specific line item in a table, including columns and relationships, by following one of the returned href links.
URL
 
 
The following response is expected:
{ "@metadata": {
"href": "http://localhost:8080/rest/default/demo/v1/@tables/[prefix]:[tablename]"
},
"prefix": "demo",
"entity": "customer",
"name": "demo:customer",
"primaryKeyColumns": [
"name"
],
"columns": [
{
"name": "name",
"type": "VARCHAR",
"generic_type": "string",
"size": 30,
"datetime_precision": -1,
"nullable": false,
"db_column_type": "VARCHAR(30)",
"length": 30,
"fixed_size": false,
"computed": false,
"is_editable": true,
"dbName": ""name"",
"persistent": true
},
{
"name": "balance",
"type": "DECIMAL",
"generic_type": "number",
"size": 19,
"scale": 4,
"datetime_precision": -1,
"nullable": true,
"db_column_type": "DECIMAL(19,4)",
"subtype": "fixedPoint",
"precision": 19,
"computed": true,
"is_editable": false,
"dbName": ""balance"",
"persistent": true },
{
"name": "credit_limit",
"type": "DECIMAL",
"generic_type": "number",
"size": 19,
"scale": 4,
"datetime_precision": -1,
"nullable": false,
"db_column_type": "DECIMAL(19,4)",
"subtype": "fixedPoint",
"precision": 19,
"computed": false,
"is_editable": true,
"dbName": ""credit_limit"",
"persistent": true
}
],
"parents": [],
"children": [
{
"name": "financeOrders",
"child_table": "finance:orders",
"child_columns": [
"customer_name"
],
"parent_columns": [
"name"
]
},
{
"name": "PurchaseOrderList",
"child_table": "demo:PurchaseOrder",
"child_columns": [
"customer_name"
],
"parent_columns": [
"name"
]
}
], "keys": [
{
"name": "SQL160816043234940",
"type": "primary",
"columns": "name"
}
]
}
POST @tables/[
prefix
]?projectId=[
123
]
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
  • The data source in which you want to add a table is marked as editable.
You can add a new table in the data source that was defined using the
@tables
 system REST endpoint and the response from the 
@databases
 endpoint:
POST @tables/[prefix]?projectId=[123]
Payload
 
Use a request payload similar to the following:
{
"entity": "
[mynewtable]
"
}
Response
 
The following response is expected:
{ "@metadata": {
"href": "http://localhost:8080/rest/default/demo/v1/@tables/demo:customer"
},
"prefix": "demo",
"entity": "customer",
"name": "demo:customer",
"primaryKeyColumns": [
"ident"
],
"columns": [
{
"name": "name",
"type": "VARCHAR",
"generic_type": "string",
"size": 30,
"datetime_precision": -1,
"nullable": false,
"db_column_type": "VARCHAR(30)",
"length": 30,
"fixed_size": false,
"computed": false,
"is_editable": true,
"dbName": ""name"",
"persistent": true,
"autonum": true
}
],
"parents": [ ],
"children": [ ],
"keys": [
{
"name": "PRIMARY",
"type": "primary",
"columns": "ident"
}
]
}
The table is added in the database. API server recognizes this new table as valid after you reload the schema.
 
PUT @tables/[prefix]:[tablename]?projectId=[
123]
 
 
Prerequisite: 
The data source in which you want to update a table is marked as editable.
For more information about how to mark a data source as editable, see Manage Existing Schemas.
You can update a table name in the data source using the 
@tables
 system REST endpoint:
PUT @tables/[database name]:[tablename]?projectId=[
123]
If you are using multiple databases, add the database name before the table name. For example 
main:Customer
.
Payload
 
Use a request payload similar to the following:
{ "@metadata":{ "href":"http://<host>:<port>/rest/abl/admin/v2/@tables/[prefix]:[table name]?projectId=[123]" }, "entity":"
[new tablename]
", }
DELETE @tables/[prefix]:[table name]?projectId=[
123]
 
Prerequisites:
 
  • You are logged in to API Creator with the Data designer role.
  • The data source in which you want to delete a table is marked as editable.
You can delete a table in the data source using the following RESTful endpoint:
DELETE @tables/[prefix]:[table name]?projectId=[123]
@views
GET @views
You can retrieve a list of the views in an API using the 
@views
 system REST endpoint:
GET @views
GET @views[/[
prefix
:]
view_name
]
You can retrieve a specific view definition for the current API using the 
@views
 system REST endpoint:
GET @views[/[prefix:]view_name]
A list of all views for the selected project id is returned. You can retrieve details about the view itself by providing the view name (found in the 
href
 of the metadata).
URL
 
https://api.acme.com/rest/acme/demo/v1/@views?projectId=[1234]
Script and Get the Meta Tag Information
You can script the meta tag information using the Live API Creator command line interface (CLI). 
The following code snippet is an example of how you can script the meta tag information:
#! /bin/bash # Uses the lac CLI #echo 1 # Note that the URL contains the entire path to the project lac login -u demo -p Password1 http://localhost:8080/APIServer/rest/default/nwindb2b/v1 -a localnw lac use localnw #Show the current license info (add --format json) for full EULA lac get @license #returns OK if server is up lac get @heartbeat # Show All Tables and columns for selected table lac get @tables lac get @tables/nw:Customers # Show All views and columns for selected view lac get @views lac get @views/nw:Current%20Product%20List # Show All Resoures and attribute for selected resources (using ident) lac get @resources lac get @resources/2961 # Show All Store Proc and attribute for selected proc (using ident) lac get @procedures #lac get @procedures/somename #Show the performance metrics for sql, rules, and admin SQL (add --format json) for detailed view lac get @perf --format json lac get @perf/sql?projectId=2047 lac get @perf/rules?projectId=2047 lac get @perf/adminSql?projectId=2047 # Swagger 1.2 doc format lac get @docs lac get @docs/nw:Customers #List of Rules lac get @rules #API settings lac get @apioptions #Information on the default auth provider lac get @auth_provider_info/1000 #Information from the Auth Provider lac get @login_info
For more information about the CLI, including how to install it and how to use it, see Install and Use the Command Line Utilities for DevOps.