API Samples

calac41
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.
In this article:
 
 
List of API Samples
 
CA Live API Creator
 includes the following API samples:
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 believe is worth exploring. The Demo database is included with the Demo API.
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:
B2B Pavlov and B2B Northwind
These API samples are an extension of the Northwind API sample and integrate with Partners, Suppliers, and multiple databases. These samples illustrate several integration concepts and scripted API creation. These samples contains an important Readiness Lab to confirm your understanding of 
CA Live API Creator
.
For more information about these sample APIs, see Business to Business Example.
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 this API sample, 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 this API sample, 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 this API sample, see RabbitMQ API Sample.
Marketing
This API sample illustrates accepting events with exhibitions and talk options, gathering responses, and enforcing budget. It illustrates a complete system from a standing start, including an autonomous service for message processing. This API sample creates a database, UI, and an API with logic.
For more information about this API sample, including how to load this API sample, see Marketing API Sample.
Northwind
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:
Banking Demo
Funds transfer application, which is patterned after TP1 samples often used for performance testing. This API 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
Captures task breakdowns, their assignments to people, sprints and releases, with controls for balancing and time posting. This API 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 this API sample, see Document Manager 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 your 
CA Live API Creator
 account type by the URL. The URL for WAR installations looks like 
http://localhost:8080/APIServer/APICreator/index.html
. For demonstration package installations, the URL looks like 
http://localhost:8080/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 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.
  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: