Using the Swagger action

Know how to use the Swagger action.

About this task

You can access APIs and make API calls of any service that is built either by using RAML, or Swagger by using the Swagger action. The Swagger action allows you to access the APIs and make API calls to any service that is built by using Swagger. In essence, this action allows you to create a custom action form by entering a JSON file.

Procedure

  1. Add the Swagger action to the canvas and then double-click the Swagger action.
  2. In the Swagger File URL field, enter the URL of the swagger JSON file for the service from which you want to retrieve the APIs. Optionally enter the service account credentials, and click the Fetch option. For example, if you want to retrieve the APIs of Petstore, enter http://petstore.swagger.io/v2/swagger.json in the Swagger File URL field, enter the credentials, and then click Fetch. Petstore is a sample Swagger JSON.
  3. A new Select an API field is added to the form. Select the API that you want to run and then click Next. After you select an API, the API form displays all the mandatory and optional fields of the selected API call.
  4. Enter the relevant data in the fields, and click Done to return to the canvas. When you test the workflow with this action, the selected API call is run.