Creating REST APIs by Importing from a URL
Explore the following steps to import an API by specifying a URL and selecting the swagger or open API file type.
Procedure
- Go to the project where you want to create an API and click the
APIs tab. You are redirected to the REST APIs page, where you see a list of any existing REST APIs for that project.
- Click Create API to go to the New API page
and select Import API using URL and click Next.
The Basic Info page appears.
- Provide a suitable name for the API you want to create in the Name field.
- Select the type of the file in the Type field. For example, select the Swagger 2.0 or OpenAPI 3.x file type.When an OpenAPI 3.x file is selected, the Document name prefix field appears.
- Enter the URL for the document in the URL(Swagger/Open API) field.
The URL must begin with
https://
. The swagger documents must be in either JSON file format with a.json
file extension or YAML. - Provide the credentials in the Username and Password field to authorize access to your swagger definition or Open API.
- Select the value as true or false in the Convert to Defined Type
field. The selected Convert to Defined Type field is visible in the
API details page and is editable.
- The default selection for Convert to Defined Type field is true. The field is only available when a REST API is created using the Import API Using URL option and using a Swagger 2.0 file. If the value for Convert to Defined Type field is selected as True, it indicates that the input variables in the request body are converted to the data type defined in the signature. However, if the value is set to False, the input variables in the request body are passed as-is in the service pipeline.
- When a REST API is created using the Import API Using URL option and using a OpenAPI 3.x file, the Convert to Defined Type field is not available.
- You can edit the Convert to Defined Type field value by using the edit option. However, to save these changes it is important to reupload the document.
- Provide the username and password only if the swagger API needs authentication, else it can be left blank.
- Click Save. The API is imported and saved for your
project. Flow services that are generated automatically by using swagger (REST APIs) are not listed in the project folder or under Monitor page filters. You can access these flow services by going to - REST APIs >
Rest API Name
> Resources and Methods >Flow service path
. The project folder is designed to facilitate business logic addition, so operations such as restart, resume, and resubmit are not there.