Page tree
Skip to end of metadata
Go to start of metadata

Overview 

DBSync Swagger 2.0/ OpenAPI 3.0  or OpenAPI adapter facilitates the user to use any homegrown applications and integrate it with other applications by enabling the Swagger API on their systems.

It is a collaboration platform where you can automatically connect SaaS applications using API with the help of DBSync Cloud Workflow.

Problem Statement

Organizations using varied applications might find it challenging to integrate with other applications to extract, transform and load data across applications. DBSync Swagger / OpenAPI3.0 adapter addresses this issue and enables the user to connect or integrate various applications supporting Swagger API.

We will be using Swagger Demo from https://petstore.swagger.io and use it to show how to integrate it using CloudWorkflow

Quick Review of PetStore API

Let us use an example of Petstore Swagger to understand the functionality of DBSync Swagger API adapter:

Setting up Swagger API  DBSync 

  • Login into DBSync cloud workflow instance

  • To setup Connector follow the steps listed below:

  • Click on connectors from the left panel and add New Connection as follows:

                                                          Fig: Connector section

  • Provide a name for the connector and choose Swagger API Connector from the drop-down menu.

  • Click Save to move to the next step.

  • Under Connector Settings add respective values as mentioned below. In this example we are setting up process to ‘Get’ method by status by either using Swagger URL validation https://petstore.swagger.io/#/pet/findPetsByStatus or add the query by using Swagger json query box.  

                                                                Fig: Connector settings 

Note: The Username, Password  are auto filled fields based on login credentials, and make changes if required while validation.

Customizable Header Feature 

During the setup process, there could be a need to have additional headers to authenticate the API calls. Our platform enables this customizable feature. In this example , an additional header would be ‘Special-key’, this helps in providing authentication to access and make API calls to the Petstore. Json query for this would be as below:

"x-additional-headers": [

{

"name": "api_key",

"in": "header",

"required": true,

"value": "special-key"

}

]

  • Post Successful validation ‘Save’ the connection.

  • This new project can be accessed under projects tab on the left navigation.

Creating a workflow process

DBSync Swagger API supports the following methods listed below. For each of these methods workflow can be created   :

Read Methods -  this can be accessed in the Trigger section of the workflow.

  • Get - this method is used to read data from a list or individually. All Get calls show up under the Trigger section of the workflow.  

                          Fig : 1.Trigger section in a Workflow 2. Select datasource 3. Select object


Write  Methods -  this can be accessed in the Rule section of the workflow.

  • Post - this method adds a new record in the target application. All post calls Show up under Rules section of the workflow and work on Insert command.

  • Put - deprecated operation can be performed using this method. All put methods Shows up Rules section of the workflow and work on Upsert command.

  • Patch - All put methods are listed under the Rules section of the workflow and work on Update command.

  • Delete - Deletion operations on API’s can be performed using this method. All delete methods are listed under the Rules section of the workflow and work on Delete command.


          Fig : 1.Rules section in a Workflow 2. Console Adapter 3. Select insert/upsert/update 4. Select console

Workflow to create ‘GetAll’

  • Let us now create a workflow - ‘GetAllPets’  which has collated  ‘Get’ queries under Processes. 

  • Click the pencil icon to edit and query all the pets.

  • A trigger section will open up. This section basically lists all the Get Calls. You can see this as the first section upon clicking the edit button.

  • Get - All Get calls show up under the Trigger section of the workflow. The Get call is basically a Read data  which will provide a list of data or individual records.

                       Fig:Selecting Swagger API from select datasource

  • Select the API (the connector that was created from the list in the Select datasource section

  • Select the Object from the list . For this example let us consider Find by Status.Refer image below. 

  • You can also select by tags, store inventory, user etc.

                                         Fig: How to select objects from Trigger section

  • Based on these conditions all the parameters are identified by the application and the Field, Operator and values columns are automatically filled.

  • Click Preview to validate.

  • Refer below image to verify validation. The query result will reflect as below if validated.

                                                     Fig - Query result post validation


  • Rules: The rules sections lists all the supported methods of calls such as the below mentioned list:

  • The rules section is embedded with a console adapter and you can integrate the data by clicking console. 

                                                    Fig: Rules Section


  • Click Map to create a mapping of the data

                                                  Fig: Mapping Screen

  • Select the schema from the drop-down

  • Click Save and Close

  • Click Save Workflow

  • A pop-up confirming the workflow is saved will appear on the screen



                                    Fig: Pop-up confirming workflow is saved

  • Click Run Now

                                   Fig:  Integration complete

  • A list of all the pets along with the json will be displayed.

Workflow to create a ‘Pet’

Now we will create a new Pet in the Petstore.

Follow the same steps to create a post call. 

  • Click the edit icon to create a post call

  • Select the datasource as console adapter

  • Select the target object as console

  • Click Preview

                                                  Fig: Trigger Section in a Workflow

  • Under Rules section enter details as below:

                                                Fig: Rules Section in a Workflow

  • Select target connector as the project you created(Petstore Swagger API)

  • Select operation: Insert, Update or upsert. For this example select Insert.

  • Select target object. For this eg select pet

  • Click Map. 

                               

                                              Fig: Mapping

  • Click Save and Close

  • Click Save Workflow

  • Click Run Now

                                            Fig: Integration complete

Steps to get started 

  1. To get started Click this link to create an account - 

https://www.mydbsync.com/product/cloud-workflow

  1. Setup your connection using similar steps listed in this document. 

  2. Create customizable processes and workflow.

  3. Use reference links below to create the same workflow.

Our Blogs 

References





 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 







  • No labels