Tutorials and Samples

View sample APIs to expedite your learning.
lac42
You can expedite your learning using the API samples that 
CA Live API Creator
 includes. Some 
CA Live API Creator
 installations, such as the single-user demonstration package of 
CA Live API Creator
 that is based on Jetty (demonstration package), include samples.
CA Live API Creator
 includes the following API samples:
API Sample Name
Functional Summary
Conference Offers and Conference Management
These API samples illustrate accepting events with exhibitions and talk options, gathering responses, and enforcing budget. They illustrate a complete system from a standing start, including an autonomous service for message processing. These samples create a database, a user interface (UI), and an API with logic.
For more information about these samples, including how to load them, see Conference Offers and Management API Samples.
B2B Pavlov and B2B Northwind
These API samples are an extension of the Northwind API sample and integrate with Partners, Suppliers, and multiple databases. They illustrate integration concepts and scripted API creation.
For more information about these sample APIs, see B2B API Sample.
Demo
This API sample illustrates basic
CA Live API Creator
 concepts. It also illustrates rules on the smallest database we believe is worth exploring. The Demo database is included with the Demo API.
For more information:
MQTT
This API sample illustrates how you can:
  • Set up a connection to an MQTT broker.
  • Set up an MQTT listener to subscribe to messages for a topic.
  • Publish MQTT messages from a function or timer. 
For more information about this API sample, including how to load it, see MQTT API Sample.
Kafka
This API sample illustrates how you can:
  • Set up a connection to a Kafka broker.
  • Set up a KafkaConsumer connection and listener to consume messages.
  • Publish a message using a KafkaProducer connection type from a function or timer.
For more information about this API sample, including how to load it, see MQTT API Sample.
RabbitMQ
This API sample illustrates how you can:
  • Set up a connection to a RabbitMQ broker.
  • Set up a RabbitMQ listener to subscribe to messages for a topic.
  • Publish RabbitMQ messages from a function.
For more information about this API sample, including how to load it, see RabbitMQ API Sample.
JMS
The JMS API sample illustrates how you can:
  • Set up a connection to a Java Message Service (JMS) broker.
  • Set up a JMS listener to subscribe to messages for a JMS topic in a publish/subscribe messaging domain.
  • Set up a JMS listener to subscribe to messages from a JMS queue in the point-to-point messaging domain.
  • Publish JMS messages from a function.
For more information about this API sample, including how to load this API sample, see JMS API Sample.
Banking Demo
This sample API illustrates a funds transfer application, demonstrating how balances are automatically computed in two bank accounts. It illustrates a small system requiring only a few dozen lines of code.
For more information about this API sample, including how to load this API sample, see Banking Demo API Sample.
Tasks
This sample API captures task breakdowns, their assignments to people, sprints and releases, with controls for balancing and time posting. It illustrates a complex system, and useful for your APIs, built in about a day, yet providing meaningful functionality.
For more information about this API sample, including how to load this API sample, see Tasks API Sample.
Oracle Sequence Example
This API sample illustrates a technical sample, such as generating keys and database sequences. This API sample generates primary keys using JDBC connections.
For more information about this API sample, including how to load this API sample, see Oracle Sequence Example API Sample.
Document Manager
This API sample is a small document manager that can store PDFs in binary fields and can display them in the browser by way of Data Explorer.
This API illustrates:
  • Non-persistent attributes
  • Formulas
  • Custom endpoints
  • Accessing binary data
For more information about this API sample, including how to load it, see Document Manager API Sample.
Northwind (database)
This database 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:
Sample
This API sample illustrates advanced rules and database concepts. It consists of an order entry, departments database of few dozen tables, with complex logic and relationships. The Sample database is included with the Sample API. This database is used in the reactive logic tutorial, which is a complex example that illustrates a recursive deep copy, using reactive logic.
For more information:
MultiThreadedDemo
This API sample illustrates how to call multiple REST endpoints from API Creator using the Java Concurrent Executors framework. Using this framework,
CA Live API Creator
can execute multiple requests in parallel, thus improving the response time of the combined API.
This API sample uses a custom endpoint and functions.
For more information about this API sample, see the MultiThreadedDemo page on GitHub.
Approximate Keys
This API sample illustrates a simple example and explores the approaches that you can use to address the issue of joining tables that have approximate keys.
For more information about this API sample, including how to load it, see Approximate Keys API Sample.
Demo and Sample Database
If you have installed 
CA Live API Creator
 on a Java container as an installable web application ARchive (WAR), you must create the Demo and Sample databases and API. If you have installed the demonstration package, the Demo and Sample databases are included, and no additional steps are required to load the Demo and Sample APIs.
You can tell which version of
CA Live API Creator
you are running by the URL. If you have installed the demonstration package, the URL looks similar to
http://localhost:8080/APICreator/index.html
. If you have installed
CA Live API Creator
on a Java container, the URL looks similar to
http://localhost:8080/APIServer/APICreator/index.html
.
Create and Verify the Demo and Sample Database
You can verify the Sample database in your favorite database tools. You can use similar load procedures for your own APIs.
For more information:
Follow these steps:
  1. Export and unpack the API export file. The Demo and Sample databases contain the following files:
    • The 
      .JSON
       export file for each API. Export files are created when you export your API.For more information about how to export 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.
  3. Load the schema and sample data from the 
    .sql
     file.
  4. (Optional) In MySQL Worbench, verify that the database is created by querying the 
    customer
     table. The following image shows the query in MySQL Workbench:
The Demo and Sample databases are created.
Create the Sample APIs
The sample APIs are available as 
.JSON
 file downloads. Create the sample APIs by importing them.
Complete this procedure once for the 
Sample
API and once (as required) for the 
Demo
API sample.
Prerequisite: 
You have exported and unpacked the API export file.
Follow these steps:
  1. Create an 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
Ensure that your tables, views, and resources are working by verifying your sample APIs. Use the REST Lab or Data Explorer.
For more information: