Creating an API
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Creating an API

You can create a new API or import an existing API from the file system using WSO2 EI tooling. You can also add an API resource to an existing API via WSO2 EI tooling.

Prerequisites

You need to have WSO2 EI tooling installed to create a new REST API or to import an existing API via tooling. For instructions on installing WSO2 EI tooling, see Installing Enterprise Integrator Tooling.

Step 1: Creating an ESB project

First, create an ESB Solution Project in ESB tooling. We will use this project to store the REST API file.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click ESB Solution Project.

  2. Enter a name for the project and click Next.

  3. Enter the Maven information about the project and click Finish.

  4. The new project will be listed in the project explorer.

Step 2: Creating an API

Following sections describe how you can create a new API.

  1. In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.

  2. Click REST API on the Developer Studio Dashboard.

  3. Leave the first option selected and click Next.

  4. Specify the API name, context, hostname, and port. For more information, see Configuring Endpoints using REST APIs.

  5. Click Finish. The REST API is created inside the src/main/synapse-config/api folder under the ESB Config project you specified.

  6. When you created the API, an API resource is created by default. If you want to add a new resource, click API Resource in the Tool pallet of the API section and simply drag and drop the resource to the REST API.

Step 3: Configuring an API resource

In the Design view of the API Resource, click the resource icon to enable the Properties tab. You can now enter the configuration parameters as given below.

  1. Specify the HTTP methods that the resource should handle. This provides additional control over what requests are handled by a given resource.

  2. Select one of the values given below for the URL style property. A resource can be associated with a user-defined URL mapping orURI template. This allows us to restrict the type of HTTP requests processed by a particular resource.

  3. Select the sequences: The resource also contains sequences (in-sequence/out-sequence/fault sequence), which contains the mediation logic to process the message.

Step 4: Defining the mediation logic

Now you can build your integration use case by adding the required mediation artifacts to the In sequence, Out sequence, and the fault sequence. 

Step 5: Deploying the API artifacts in the ESB server

You need to create a Composite Application project with a CAR file. You can then deploy the CAR file in the ESB server:

  1. Right-click the Project Explorer and click New > Project.

  2. From the window that opens, click Composite Application Project.

  3. Give a name to the Composite Application project and select the projects that you need to group into your C-App from the list of available projects. You need to select the ESB project, which contains the proxy service and security policy file respectively.

  4. Next, deploy the CAR file in the ESB server.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.