Create your API
Create your API
calac41
The following diagram illustrates the approaches that you can use to create your API using
CA Live API Creator
:.png/_jcr_content/renditions/original)
Whatever approach you use, you can iterate quickly. You can receive immediate feedback from business users while continuing to refine application logic and develop custom client interfaces (applications). The APIs you create using API Creator provide enterprise-pattern automation, including optimistic locking, pagination, and generated key support.
Follow these steps:
- In API Creator, on the APIs page, clickCreate New API.The connection wizard opens. The following image shows the connection wizard:
- Click the approach you want to use to create your API:If you are new to creating APIs using API Creator, we recommend that you create your API by connecting to the Northwind sample database (clickDatabase First, and then clickExample Northwind database).
- Database FirstWith theDatabase Firstapproach, create your API by connecting to an existing database. This approach creates a default API based on schema discovery. You can then extend your API.Prerequisite:You have the database server information and credentials required to connect to the database.In the connection wizard, connect to your database by selecting one of the following options, and then clickContinue:
- Example Northwind database.This option connects your API to the Northwind sample database.
- Target database.Click the target database to which you want your API to connect. Then complete the following steps:
- Enter the required connection properties that the JDBC driver requires.For more information about the connection values for each target database that is listed in the connection wizard, including information about how to set up to connect to one of these data sources, see the following articles:The connection wizard displays the database drivers thatCA Live API Creatorsupports.For more information about the supported drivers, see Installation Requirements and Supported Platforms.
- (Optional) To test your connection to your SQL database with the URL credentials, clickTest Connection. Your new API requires a successful database connection. API Creator reads the schema tables, views, procedures, keys, and relationships and connects the database to API Creator.
- ClickContinue.
- Click one of the following:
- Proceed to API Properties.
- Proceed to API REST Lab.
- New empty database.This option creates an API for a managed database.Prerequisite:You have added a managed data server and it is active.For more information about how to add a managed data server, see Managed Data Server Administration.
- Empty API.This option creates an API without an initial database connection.
- JNDI data source.Select this option if your connection information is not stored in the admin database or if you want greater flexibility in leveraging database management system (DBMS)-specific options, such as SSL access and mirroring.Firewalls require accommodations.
A default API that matches your schema and a connection to the database are created.For more information about how to view your schema, see Database Connectivity.
- App FirstWith theApp Firstapproach, you create an empty API, connect to a managed data server, and then add a data source for a managed database. With this approach, you create your tables, fields, and data using Data Explorer. API Creator creates your application, your schema, and your default API.Prerequisite:You have added a managed data server and it is active.A default API is created. Data Explorer starts in a new browser window in Author Mode. Build your application using Data Explorer.If you are using the defaults, enter
as your username andadmin
as your password.Password1For more information:- About using Data Explorer in Author Mode, see Author Mode.
- About how to build an application using Data Explorer, see Manage Tables in Managed Databases.
- About how to add a data source for a managed data server while creating your API, see Managed Data Server Administration.
- Code FirstWith theCode Firstapproach, you create an empty API and then customize your API by writing JavaScript functions, JavaScript resources, and custom endpoints in JavaScript. You can get help in writing your custom code using code completion, logic libraries, and the debugger.For more information:
- About how to create functions, see Manage Functions.
- About how to create custom endpoints, see Manage Custom Endpoints.
- About code completion, see Code Completion.
- About how to use logic libraries, see Logic Libraries.
- About the debugger, see Debugger.
- Model FirstWith theModel Firstapproach, API Creator creates your data source for a managed database and your default API. You convert a model, such as Swagger, to schema format and then create your schema and API by importing your model (JSON file).Prerequisite:You have added a managed data server and it is active.A default API is created and its associated database is created.For more information:
- About how to import a model file into your API, see Swagger to Schema.
- About how to add a managed data server, see Managed Data Server Administration.
Watch the Video
For more information about how to create your default API, watch the following Creating APIs - Alternatives video:
Next Steps
Now that you have created your API, you can:
- Customize your Favorites SectionThe Favorites section in API Creator includes links to the Learning Center, the Resources page, the Rules page, the REST Lab, and to Data Explorer by default. You can add more links to API Creator pages, remove links, and reorganize links using the drag-and-drop method.
- Customize your API with resources that you explicitly define.For more information about how to define these resource, see Customize your API.
- Enhance and extend system automation for update and retrieval logic with procedural code using server-side JavaScript.For more information, see Extensibility.
- Explore your data and create new databases using Data Explorer.For more information about how to use Data Explorer, see Data Explorer.