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.
calac41
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
CA Live API Creator
provides. CA 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 Role-Based Endpoint Access.
The examples that are shown in this article assume that you are sending an auth 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
endpoint: GET @apioptions
URL
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-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
you identify using the following @apps
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 following
@auth_provider_info
endpoint by passing in the ident
of a specific authentication provider:GET @auth_provider_info[/ident]
@authentication
POST @authentication
You can authenticate an API user and obtain an authentication token using the following
@authentication
RESTful endpoint and the following payload:POST @authentication
You can use the authentication token with every request to the server. API Server calls the custom authentication provider. API Server is passed the credentials (for example, user and login) and returns the list of roles it uses for authorization.
An authentication token is generated for every successful
@authentication
RESTful endpoint request.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.
- 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 following
@columns
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.For more information about how to mark a data source as editable, see Manage Existing Schemas.
You can modify a field in an existing table in the data source using the following RESTful 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 following RESTful 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
endpoint:GET @data_sources
Only auth tokens that have a role with a permission for the
pseudo-table can call this endpoint.@metatables
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 following
@databases
managed data 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 following
@databases
managed data REST endpoint by passing the ident
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 following
@databases
managed data REST endpoint by providing the database name and the managed server ident
value:DELETE @databases/databasename?managed_data_server_ident=2000
For more information about the Data designer role, including all of the roles for creating databases and managing tables and fields, see Admin Authentication Providers.
@dependencies
GET @dependencies
You can retrieve dependencies information using the following
@dependencies
RESTful 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 following RESTful 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), which supports multiple languages, using the following
@eula
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
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 following
@functions
RESTful 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 the server status using the
@heartbeat
endpoint:GET @heartbeat
URL
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 includes an auth token (is authenticated) or not using the
@license
endpoint:GET @license
URL
Response
If the call includes an auth token, 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 you do not include an auth token in the call, 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 used by the authentication provider using the following
@login_info
endpoint:GET @login_info
For more information about authentication, see Authentication.
@metatables
GET @metatables
You can retrieve a list of most of the APIs listed on this page using the following
@metatables
RESTful 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" } ]
@perf
GET @perf
You can retrieve an object containing pointers to the performance statistics using the following
@perf
RESTful endpoint:GET @perf
For more information about the performance metrics, see Analyze Metrics.
GET @perf[[rules | sql | adminSql]?projectId=[2000]
You can retrieve performance statistics for a specific API using the
@perf
endpoint:GET @perf[[rules | sql | adminSql]?projectId=[2000]
This call returns the following statistics:
- Execution of rules.
- Execution of SQL for your database(s).
- Execution of SQL for the admin database.
Response
The following response is expected:
{ "meta": { "currentTime": 42132335320569 }, "stats": [ { "rule": { "ident": 2000, "entity": "demo:customer", "type": "validation", "name": "Validation return row.balance <= row.credit_limit;" }, "firstExecutionTime": 37501167023156, "lastExecutionTime": 37501167023156, "shortestExecutionTime": 1585839, "longestExecutionTime": 1585839, "numberOfExecutions": 1, "totalExecutionTime": 1585839 }, { "rule": { "ident": 2002, "entity": "demo:customer", "type": "sum", "name": "Derive balance as sum(PurchaseOrderList.amount_total where paid = false)" }, "firstExecutionTime": 37501164919658, "lastExecutionTime": 37501164919658, "shortestExecutionTime": 1437219, "longestExecutionTime": 1437219, "numberOfExecutions": 1, "totalExecutionTime": 1437219 }, { "rule": { "ident": 2005, "entity": "demo:PurchaseOrder", "type": "event", "name": "Audit Purchase Order amount changes" }, "firstExecutionTime": 37501158809963, "lastExecutionTime": 37501158809963, "shortestExecutionTime": 10199279, "longestExecutionTime": 10199279, "numberOfExecutions": 1, "totalExecutionTime": 10199279 } ]
@procedures
GET @procedures
You can retrieve a list of all stored procedures using the following
@procedures
RESTful 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 about stored procedures using the
@procedures
endpoint, you can retrieve full information for the stored procedure using the following GET against URL for that stored procedure:GET @procedures[/procedure_name]
You can also retrieve metadata on functions and packages using the
@procedures
endpoint.
The following response is expected:
{"@metadata": {},"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 following
@relationships
managed data 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 CA Live API Creator Admin project API (Admin API).
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.For more information about how to mark a data source as editable, see Manage Existing Schemas.
By default, if you do not pass in parent and child column names,
CA 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,
CA 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 following
@relationships
managed data REST endpoint:You must make this call from the Admin API.
For more information about this API, see Programmatic API Creation.
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 following
@relationships
managed data REST endpoint by providing the table prefix+name for the table:You must make this call from the Admin API.
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 following
@resource
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
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", "functions": [], "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 following
@resource
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, "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 you have defined in your API using the following
@rules
RESTful 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
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 POST@schema
REST endpoint API:@schema
GET @schema/[datasource_prefix]?projectId=123
If you use this endpoint in REST Lab, then the
prefix
must be one 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 name |
| An array of comma sepaerated column names. |
| An array of columns in JSON. Attributes:
|
| An array of relationships in JSON. Attributes:
|
| A collection of primary and candidate keys with each containing the following attributes:
(primary|candidate) and (array of string names). |
Advanced Options
The following properties default to
false
if flag is not present:- skiptablecreation = true |falseIf true, ignore the creation of tables and column and only process relationships
- skiprelationships = true |falseIf true, ignore the creation of relationships and only process tables and columns (useful for data import)
- ignoredbcolumntype = true|falseUse
and subtype instead ofgeneric_type
.db_column_type - ignoreprimarykeyname=true|falseIgnore the provided primary key name and generate a new name.
- ignoreconstraintname=true|falseIgnore the provided relationship constraint name in parents and generate a new name.This property uses theprefixof the selected API. Thisprefixmust 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 new schema using the following
@schema
managed data 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 following
@sequences
RESTful 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 following
@serverinfo
RESTful 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 following
@tables
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/[
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.prefix
]:[tablename
]URL
{ "@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.For more information about how to mark a data source as editable, see Manage Existing Schemas.
You can add a new table in the data source that was defined using the following
@tables
managed data 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 following
@tables
managed data 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.For more information about how to mark a data source as editable, see Manage Existing Schemas.
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 following RESTful endpoint:
GET @views
GET @views[/[
prefix
:]view_name
]You can retrieve a specific view definition for the current API using the following RESTful 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
of the metadata).href
URL
https://api.acme.com/rest/acme/demo/v1/@views?projectId=[1234]
Script the Meta Tag Information
You can script the meta tag information using the command line interface (CLI). For a complete list, download the file.
The following code snippet shows the contents of this file:
#! /bin/bash # Uses NodeJS and the command line interface # npm install liveapicreator-cli -g # CA Live API Creator meta @ rest endpoints #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 NodeJS and Command Line Utilities.