Importing from Swagger and OpenAPI 3.0 Apis

The Open API specification is an API description format for the REST APIs. It enables APIs to define their own structure. The API specification is easy and can be written in JSON or YAML. With the Open APIs specification file, you can get all the available endpoints and all the operations available for the endpoints, the input and output parameters, and authentication methods.

With Studio you can add any of your Open API docs and auto-create APIs. It thus makes it easy to add services from third-party SaaS products.

To add REST APIs, under Studio > Connectors, click (+) Connector. Under APIs you can add the REST APIs to add any third-party API not listed out under the Connector lists.

  • Select REST API.

  • Enter the Connector name and the simple API endpoint that can be used to test the user credentials. Depending upon the input parameters required you can add the input parameters for the respective API under Advance options.

  • Provide a GET method here and click Continue to test the configuration

  • Once the configuration settings are done you need to Test the endpoint. This way you would be adding the necessary parameters and testing the configuration. Under Response you would see the response values from your respective API. When the request is successful it will show the respective message.

  • Click Continue and the process is complete. Your API can be seen under Custom API Connectors now.

Import API

So once the JSON file is uploaded you can choose from the APIs available in the document that you want to use in your Studio apps to enhance their functionality.

  • Click Select All, to select all the API or you can individually select the APIs that you need. You can see the descriptions for each of the API if it is provided in the document. The APIs would be listed out as per the name specified in the document.

  • Click Import to import the selected APIs.

Now if you go to Connectors, you can see the REST API that you added with all the APIs that you selected. If you have any dynamic parameters you can Edit the API and make the necessary changes and updates. Let us take the example of the Petstore from above to get records based on the Status. In this example, we would like to get the Status as input from a Dropdown control. So when you configure your Connector query to Find data by Status in this case, you would need to pass a variable as a query string parameter. It needs to be enabled before so that it can be passed dynamically during run time.

So now let us display the data using a Table grid control. So configure using Bind Data > Connectors. In this case, when you are configuring the connector, you can see that the Status variable is assigned the value selected from the Dropdown.

You can test the configuration and click Test & Finish. Select the Keys to display data using the Table grid.

tablegrid status data

Now if you run this form you can see that based on the Status you select from the Dropdown you would get the data from your PetStore API that we used in this example.

Refresh Response

At times the JSON specification file does not have an API response schema. In such a scenario you can use the Refresh Response which might then help you to fetch the response and generate the keys to bind data.

Now let us consider another example to get data from the API. In this example for the same Petstore sample from Swagger that we used earlier, we want to get data based on Tag. The API is available for a GET method accordingly but does not have the response schema. Now if you are configuring the connector using Bind Data > Connector option, you would typically select the Connector and then the specific API to get the list of Keys to bind data to control. However, here the keys are not available.

So now if you go to the connector configuration again and click Refresh Response, you would see the Keywords are available for binding data.

The Refresh Response eliminates the need to create keys using any function. You can fetch and display data from the API using the control like a table grid control.

With Import API you have now the flexibility to choose your SaaS service and quickly connect to further enhance the functionality of your Apps.