With Apinizer, it is very easy to create an API Proxy using an existing API/Web Service as a Backend API, or create an API Proxy without a Backend API and publish it as an API. In this section, it will be given how to create an API Proxy using the URL information of an API in Swagger 2.x format, and the details of the related options and data fields will be explained.

The steps followed when creating a sample API Proxy below are the same as those described on the Quick Start page, but there are explanations for the data fields in this section.


1- Development → API Proxies is selected in main menu.

2- Click the +Proxy button at right top side of the interface.


3- Options to create the API Proxy will be displayed.


TypeDescription
Swagger 2.x

It is the widely used API Definition File standard for the REST protocol. Click here for more information.

WSDL (SOAP)

It is the Web Service Definition File standard of the SOAP protocol. Click here for more information.

OpenAPI/Swagger 3.0.x

It is an API Definition File standard created after Swagger for the REST protocol. Click here for more information.

Reverse Proxy

It is used to send incoming requests to a Backend API regardless of whether there is such a method/endpoint, and return the responses returned from the Backend API to the client. There is no need for a definition file, and there is no need to define the methods/endpoints of the Backend API one by one. It is sufficient to give the root context of the backend API.

Empty API


Provides ability to manually define the methods/endpoints of and create create an API Proxy for an API which was previously developed in code-first approach and has no definition file. Apinizer automatically generates API definition files in Swagger or OpenAPI formats according to the definitions.

Mirror API

It is the API that returns the submitted request as a response. Sometimes you need a working API that will return a response just to be able to test how the written code works. The important thing in this scenario is to be able to send a request and get a response. It may also be good if the content of the response can be specified conditionally. Developing an API for this and uploading it to a server requires both time and effort. In such a case, the Mirror API provides an API that can be put into service instantly without any development and does not require a server or installation, and where the return response can be changed by changing the request sent to it.


There are some additional options below the options.

OptionDescription
Enter URL

API Proxy can be created by specifying the URL where the API Definition Document of the API for which API Proxy is to be created is accessible. 

Examples: 

https://petstore.swagger.io/v2/swagger.json

http://www.dneonline.com/calculator.asmx?WSDL

Upload FileAPI Proxy can be created by uploading the API Definition Document of the API for which API Proxy is to be created is accessible. 
Select API SpecAPI Proxy can be created by an API Spec that was previously created with the API Spec Creator.


Click the Enter URL link for Swagger 2.x from the options in the New API Proxy creation interface.


4- Following data fields appear on the interface.


FieldDescription

Use Spec Authorization

Some definition files check that the client is authorized so that their content can be viewed. For this, authorization data must be sent within the HTTP request. If the definition file in the URL to be accessed is such a file, this box is checked and the credentials are entered.
URLThe URL of the API Definition Document. 


If the Use Spec Authorization option is checked, the table below appears and the keys required for authorization are added.


The Use Spec Authorization option is not needed for this example. Type the address https://petstore.swagger.io/v2/swagger.json in the URL field and click the Parse button on the right.


5- The information of the API is displayed by parsing the Swagger file at the address given in the URL field. The fields in the incoming interface are explained in the table below.

Field

Description

NameThe name given to the API Proxy by the user. This name is displayed in interfaces.

Description

An optional brief description about the API Proxy.

Usage

Specifies the usage type of the Backend API. Options:

  • Publisher: Backend API is opened by the company/institution itself.
  • Consumer: Backend API belongs to another company/organization. API Proxy is created to access that API.
  • Publisher & Consumer: The API Proxy created for a Backend API belonging to another company/organization is also created to be used by 3rd parties.

Addresses

Addresses that the Backend API is accessible.

Relative Path

Relative Path is a part of the access URL of this API Proxy.

The API Gateway's address is used to direct incoming requests to the appropriate API Proxy. For this, a unique address is created using the Relative Path for each deployed API Proxy, as in the example below:

Let the address of the server where Apinizer is running is https://demo.apinizer.com.

Let the Relative Path is /petstoreProxy.

Let the address of the Environment that the API Proxy is deployed is /apigateway

Let the endpoint to be accessed is /findByStatus.

Then, the URL of this endpoint on this Environment will be https://demo.apinizer.com/apigateway/petstoreProxy/findByStatus.

The Relative Path must be unique among the Project.

If the Enable Relative Path value is enabled for the Project while making the Project settings, the Relative Path defined for the Project will be prefixed to the Relative Paths of all API Proxies created in this project.

Category List

Categories can be created to facilitate the management of API Proxies. The category list is used to identify which categories the API Proxy belongs to.


Check https://petstore.swagger.io/v2 within the Addresses part, and enter /petstoreProxy into the Relative Path textbox. Click the Save button on the top right of the screen to complete creating the API Proxy.