Prerequisite knowledge
Required products
User level
No Prerequisite knowledge required
Adobe ColdFusion Enterprise Edition (2016 release) (Download trial)


This article describes three different ways of creating an API using the API Manager platform. They are:
  1. Creating an API manually
  2. Importing an API from swagger
  3. Importing an API from ColdFusion
This article also describes how to consume an API.

Create REST API manually

As an example of creating an API manually from scratch, you can build an API, GenderChecker. The API takes a name as input and returns if the name belongs to a male or a female.
The server side of this API already exists, as shown below:
In the example, '' is the endpoint, 'analysis' is a resource, and 'firstname’ is the parameter.
To create the API using API Manager:
Step 1
Log in to the API Manager portal as publisher.
Step 2
After you log in, click Create API on the left navigation panel. Click Create REST API.
Step 3
Enter the details of the API. You can assign any meaningful name to the API. Specify the endpoint as ''
Step 4
Now move to the Resources section. The example API has only one resource, which you can add. Enter /analysis and choose GET method. To add the resource, click Add Resource. You can expand the resource by clicking on the green arrow.
Step 5
Add the parameter firstname. The parameter is of type query.
Step 6
To publish the API, click Publish.
Step 7
Once the API is published, you can preview of the API. You can verify the details and if required, edit and re-publish the API.
Step 8
To test this API, click Test this API on the left navigation panel. Expand the resource.
Step 9
Enter the value of parameter firstname. Choose Produces. Here, there is a single option. And finally, click Run API Call. Once the API call is complete, you can see the result along with the response and request details.
The REST API is complete and is ready for use.

Create API from swagger

Swagger is a formal specification surrounded by a large ecosystem of tools, which includes everything from front-end user interfaces, low-level code libraries, and commercial API management solutions. The API Manager supports importing an API from Swagger 1.2 and Swagger 2.0..
To import a Swagger doc:
Step 1
In the Create API page, click  Import REST API from Swagger.
Step 2
Enter the URL of the Swagger doc. In this example, use petstore’s swagger doc.
Step 3
After clicking Import , the REST API is generated using this Swagger doc. Details like version, description, and so on are fetched from the Swagger doc.
Step 4
In the Resources section, you can view all the resources of the Petstore Swagger doc.
Step 5
To publish the API, click Publish.
Step 6
Test the API.
The API imported from a Swagger doc is now ready for use.

Create API from ColdFusion

In the API manager, you can also import REST services registered in any ColdFusion server. To register a ColdFusion server with the API Manager:
Step 1
In ColdFusion administrator, you can enable discovery of rest services. In the settings page, enable the option.
Step 2
Register a REST service. The service is a basic CFC that returns the current date.
Step 3
Register the REST service in ColdFusion admin.
Step 4
In the API Manager administrator, register the ColdFusion server.
Step 5
In the API Manager portal’s Create API page, click Import REST API from ColdFusion. You can see a pop-up containing all registered ColdFusion servers and all registered REST services.
Step 6
Import any REST service. You can see the resources.
Step 7
Publish and test your API.
The ColdFusion REST service is ready for use via the API Manager.

Subscribing to an API

Once you publish an API, consumers can consume it.
Step 1
As a publisher, you can create an API. To subscribe to an API, switch to subscriber view.
Step 2
Navigate to the API catalog to browse all publicly available APIs. Click on any API you want to subscribe.
Step 3
Once you click an API, you can see all the details of the API. You can even try out the API before subscribing to it.
Step 4
Go to the Subscribe section. Choose the application you want to subscribe Choose the SLA plan you want to subscribe to and finally click Subscribe. You can now use the application key to invoke the API.

Where to go from here

In the next few articles, we will describe how to create REST API from SOAP, importing SOAP API, and other advanced features of API Manager.