API Samples

This article includes a list of the API samples, their purpose, and how to load them. You can use similar load procedures for your own APIs.
lac32
This article includes a list of the API samples, their purpose, and how to load them. You can use similar load procedures for your own APIs.
In this article:
API Samples
The following API samples are included with the single-user demonstration package of 
CA Live API Creator
 based on Jetty:
API Sample Name
Functional Summary
Demo
This API sample illustrates basic 
CA Live API Creator
 concepts. It also illustrates rules on the smallest database we think is worth exploring. This API includes the Logic Demo database.
You can also load this API sample if you have installed 
CA Live API Creator
 in another Java container.
For more information about the Demo API, including how to load this API sample into your installation, see Business Logic API Project Sample.
Sample
This API sample illustrates advanced rules and database concepts. This API includes the Logic Sample database. The database consists of an order entry, departments database of few dozen tables, with complex logic and relationships. The Reactive Logic tutorial uses the Logic Sample database. The Sample API is a complex API sample that illustrates a recursive deep copy, using reactive logic.
You can also load this API sample if you have installed 
CA Live API Creator
 in another Java container.
For more information:
This API sample illustrates a few simple rules on the well-known Northwind reference database. 
Create a Northwind API sample by connecting to the Northwind database.
For more information about how to create a Northwind API sample, see Create your API.
The following are other API samples that you can load into your installation:
API Sample Name
Functional Summary
Purpose
Creates database tables from spreadsheets/CSV files.
A complement to managed databases and an example of metadata APIs.
Accepts conferences with booth and speaking opportunities, gathers responses, and enforces budget.
A complete system from a standing start. Creates database, UI, and API with logic.
Extension of Northwind to integrate with Partners and Suppliers, as well as multiple databases.
Illustrates several integration concepts, and scripted API creation. This database contains an important Readiness Lab to confirm your understanding of 
CA Live API Creator
.
Funds transfer application, patterned after TP1 samples often used for performance testing.
Illustrates a small system requiring only a few dozen lines of code.
Captures task breakdowns, their assignments to people, sprints and releases, with controls for balancing and time posting.
A complex system, and useful for your APIs, built in about a day, yet providing meaningful functionality.
No DB
The Hello World is a simple API with no database.
For more information about the Hello World API sample, see Define a Custom Hello World Authentication Provider using JavaScript.
Creates an API with a line of code.
Technical sample, such as generating keys and database sequences.
Uses JDBC connections to generate primary keys.
This sample is a small document manager that can store PDFs in binary fields and display them in the browser by way of Data Explorer.
It illustrates:
  • Non-persistent attributes
  • Formulas
  • Custom endpoints
  • Accessing binary data
Account Types
The following table summarizes the different account types that are available. Your account type determines whether the Logic Demo and Logic Sample databases are available or require installation.
 
 
Account Type
 
 
How can I tell?
 
 
Available or requires installation?
 
 
Sample DB and API
 
 
Sample API
 
WAR installation in a Java container
  • You have installed the WAR file.
  • Your URL looks like:
    http://localhost:8080/APIServer/APICreator/index.html
  • Your API Server URL looks like:
    http://localhost:8080/APIServer
Requires installation.
For more information about how to create the Logic Demo database, see the "Create and Verify the LogicDemo and LogicSample Database" section.
For more information about how to download the Logic Demo database, see the LogicDemo page on GitHub.
Requires installation.
For more information about how to download the advanced Logic Sample database, see the LogicSample page on GitHub.
Requires installation.
For more information about how to create the LogicSample database, see the "Create and Verify the LogicDemo and LogicSample Database" section.
The single-user version of 
CA Live API Creator
 based on Jetty
  • You installed the self-contained, single-user version of 
    CA Live API Creator
    , which is a demonstration package based on Jetty. For more information about how to install this demonstration package, see Installing and Upgrading.
  • Your URL looks like:
    http://localhost:8080/APICreator/index.html
  • You API Server URL looks like:
    http://localhost:8080
Available.
Available.
Available.
Create and Verify the LogicDemo and LogicSample Database
If you are using the Web application ARchive (WAR) file, create the Logic Demo and Logic Sample database and API. Otherwise, the Logic Sample database was already created while building your server. You can verify it in your favorite database tools.
  1. Export and unpack the API export file. The Logic Demo and Logic Sample databases contain the following files:
    • The API's 
      .JSON
       export file. Export files are created when you export your API.For more information about exporting APIs, see Import and Export APIs.
    • SQL files. Use these files to initialize the schema and data.
  2. Create the 
    dblocal_demo
     and 
    dblocal_sample
     schemas.For more information about creating schemas, see the "Create the Admin DB Schema" procedure in Install on Apache Tomcat.
  3. Load the schema and sample data from the 
    .sql
     file.
  4. (Optional) In MySQL Worbench, verify the database is created by querying the 
    customer
     table. The following image shows the query in MySQL Workbench:
      
The Logic Demo and Logic Sample databases are created.
Create the Sample APIs
The sample APIs are available as 
.JSON
 file downloads. Use the following procedure to import them. Complete this procedure once for the Logic Sample databases and once (as required) for the Logic Demo database.
Prerequisite: 
You have exported and unpacked the API export file.
  1. Create a new API by importing the unpacked
    .JSON
    file.For more information about how to import API definitions, see Import and Export APIs.
  2. Fix the imported API by re-supplying the security information that was not included in the
    .JSON
    export file.For more information about how to fix imported APIs, see Import and Export APIs.
The sample APIs are created.
Verify the Sample APIs
Verify your sample APIs by going to REST Lab or Data Explorer and see if your tables, views, and resources are working.