Getting Started‎ > ‎

Product Walk-Through

This page introduces API Creator's key concepts and explains how to use the samples to see these concepts.

For more information about additional training resources, see the Training Guide.

Prerequisites: Before you start, complete the following:
  • Explore the Welcome Window and the Architecture for suggestions on getting started.
  • View the Videos.
  • Take the tour.

Take the Tour

The tour automatically starts after you log in to API Creator. This tour illustrates how to create APIs, with default resources for each table, view, and stored procedure by creating your first API using Northwind.

Note: You can change the expected response format globally across an API. For more information about changing this API setting, see API Properties.

REST Lab

Creating an API invokes the REST Lab. Use the REST Lab to confirm your API is operational and to query and update data. Explore its services for filter, sort, etc. Observe pagination of large results and optimistic locking.

For more information about the REST Lab, see Test your API Using the REST Lab.

Stored Procedures

Creating an API creates stored procedures as endpoints. You can test these endpoints:
  • Northwind MySQL. Select Procedure, CustOrdersDetail and append the following to the URL: 
?arg.OrderID=10248
  • Demo MySQL. Select Procedure > get_employee and append the following to the URL:
?arg.given_employee_id=1&arg.plus_one=1

Note: Java DB does not support stored procedures. Therefore, the demonstration package based on Jetty does not include stored procedures.

Swagger Documentation

View code samples, including automatically-created Swagger documentation.

Custom Resources

The tour shows you how to define custom resources. Observe there was no code generation or deployment. View the Demo API and explore the CustomerBusinessObject. Run the custom resource in the REST Lab.

For more information about defining custom resource types, see Customize your API.

Free SQL Resource Types

While SQL is ordinarily automated, you can provide your own SQL when necessary using Free SQL Resource Type. In the Demo API, select Resources, PurchaseOrdersFreeSQL, Details. The Details tab contains custom SQL.

For more information about defining Free SQL resource types, see Define Free SQL Resource Types.

JavaScript Resource Types

You can materialize resource responses with JavaScript resource type.

  1. In the Demo API, click CustomerJSOrdersRest resource, OrdersRest sub-resource, Details.
  2. View the JavaScript in the the Details pane.
  3. Explore JavaScriptMongo, which is the root resource by way of JavaScript that makes direct calls to Mongo APIs.

For more information about defining JavaScript resource types, see Define JavaScript Resource Types.

MongoDB Resource Types

You can create resources that map to MongoDB resources:

    • CustomerJoinMongoPurchaseOrders (sub resource by way of JavaScript).
    • zipcodes
Note: The demonstration package does not presume Web connectivity. Therefore, this package does not include these resources.

Custom Endpoints

You can create ad-hoc endpoints using custom endpoints. Create a sample endpoint on the Create, Custom Endpoints page.

For more information about creating custom endpoints, see Create Custom Endpoints.

Integrate Databases into a Single API Project

APIs can integrate databases into a single API and inter-operate with other systems.

Multiple Data Sources: SQL

Explore Resources, MDBDemoCustomers. Customers come from Demo, Orders from Sample.

Note: These can be different database types.

Multiple Data Sources: Non SQL

The previous examples illustrated integration:
  • CustomerJSOrdersRest illustrates integrating SQL and external RESTful data.
  • CustomerJoinMongoPurchaseOrder integrates SQL and NoSQL data into one nested resource.

Systems Integration

Switch to the Sample API.

For more information about exploring this example, see Integrate Systems and Data.

Data Explorer

Switch back to the Demo API. Go to Data Explorer and experiment with filtering, sorting, updates, and lookups. Customize with Author Mode.

For more information about Data Explorer, see Data Explorer.

Manage

Manage your business policy for logic and security, using rules, JavaScript, and point-and-click forms.

Rules - Reactive Logic

Ensure database integrity with a combination of server-side JavaScript events and reactive logic.

For more information about rules, see Specify your Business Rules.

JavaScript Events

Go to Rules, Event: Audit Purchase Order. This event coded with server-side JavaScript. Key points:
  • Your object model is created for you, as used in the first line (row.amount_total != oldRow.amount_total).
  • Contextual variables are passed to you.
    For more information about the JavaScript contextual variables, see Quick Reference.
  • Build code using the Expression Help.

The Send Mail example illustrates calling your own loadable Java/JavaScript libraries.

Tip! If the shortened left navigation menu is displayed, to view the libraries, clear the Short Menus checkbox, then go to API Properties, Libraries.

Reactive Logic

Save time by using reactive logic:
  1. See the reactive logic for this topic (requirement) by going to Rules, Check Credit.
  2. For more background, click Edit Topic.
You can define topics (API Properties, Topics). Topics can include rich text links, such as to a Requirements Management system.

Security

In the Demo API, you can explore role-based control over which resources a role can access, and which rows are returned.

Note: You can also use a custom authentication provider. While not used in the Demo API, you can explore using a custom authentication provider in the Business to Business Example.

You can explore security in the following ways:

  1. Use the Rest Lab with the SalesRep auth token and observe "no such resource" on GET to PurchaseOrders.
  2. Go to the Manage, Security page, select the Sales Rep role, and then click the REST End Points tab and authorize access to PurchaseOrders (Steps 1-2-3 in the following image. Click the thumbnail to see the full screen):
  3. Return to the Rest Lab, and verify you can GET PurchaseOrders. Note the number of lines of output.
  4. Use the Broad Access auth token. GET and observe that more data is retrieved. This illustrates row-level security. Different rows are returned based on the user's set of roles.

Such security can involve the use of global rows/variables. Go to the Manage, Security page, select the Sales Rep role, and then click the Permissions tab (click the thumbnail to see the full screen).

 @{current_employee_row.employee_id}current_employee_row is defined on the Manage, Security, Globals tab.

For more information about security, see Authentication.

Dev

Debugging

Alter a Lineitem quantity using Data Explorer (or REST Lab) and observe the effect on related objects by examining the logs. The log shows every SQL and every rule (including row state), with indention for multi-table chaining.

Export

You can create versions of your API, which requires that you export the API, update their settings, and then import it. This is a good way to move APIs from dev to pre-production to production, source control them, etc.

For more information about exporting APIs, see Import and Export API Definitions.

Next Steps

Create your own API Project

After you have completed the steps above, get started by creating a new API, which contains your resources, logic, and security. First, connect to a database. The database can be one of the following:
    • An existing database, in the cloud or on-premises.
    • A new database you create using your existing tools and procedures or the database API Creator creates automatically.

Advanced Example

You can extend Northwind to illustrate the Business To Business integration. The Business To Business integration illustrates several useful Live API Creator concepts that can be helpful in real-world projects.