webMethods.io Integration Tutorials

Creating Custom Actions using Swagger Files

webMethods.io Integration supports 250+ connectors to help you create smart integrations faster. Moreover, it lets you create custom actions/triggers using the Connector Builder or by importing your existing Swagger files.

In this tutorial, we will understand how to create a custom action using a Swagger file.

Note: We will soon roll out a feature to support creating triggers through Swagger files too.

In order to create a custom action, you would need to install the Connector Builder on your system first.

Installing Connector Builder

To install the Connector Builder, follow the instructions given below:

Note: The Node version should be between 8.14.0 and 10.14.2.

Note: To get the tenant developer key, navigate to Tenant profile icon->Settings->My Information->Developer key.

Importing Swagger file

Once you have installed the Connector Builder, the next step is to create a custom action for the application of your choice. To do so, follow the instructions given below:

Note: If the authorization type is set to ‘Connection’ or ‘Token’, the relevant action will be created automatically.

On selecting ‘Other’, a list of available OAuth providers will be displayed on the screen. Select the required OAuth provider from the given list.

To proceed without creating an authorization, select ‘Skip’. the required actions will be created automatically.

Note: You can alternatively add an authorization using the command: wmio auth

To learn how to add an authorization using this command, click here.

Note: The created OAuth will be used by all the actions that are present in the V1 folder of the action directory.

Testing the action

Testing the custom action is an optional step. However, it is recommended to perform this step to ensure that the code you have written is working as expected.

Note: The testing will be done against the mock data you have provided in the code.

We will now understand how to test the action with the help of an example. Suppose we want to test an action that is created using the example swagger file, foldersfolder_id__itemsget. To do this, follow the steps given below:

To test the action, add mock_input object below the output object as shown below:

Note: The mock_input object should have all keys (of the input schema) present in the input object.

With this, the action is ready to be tested. Now you can run the command - wmio test - to test the action.

Note:

  • A file named auth.conf will be automatically created at the root level of the current directory. This file contains an object with Authorization details (as shown below) of the action that needs to be tested. The Authorization details will be used by CLI while testing the action.
  • Ensure that the index.json file contains only those actions in the array that you would want to test.
  • In case the index.json file contains an empty array of actions, then only the passed access token will be validated. The validation will be performed using the validate function present in the authentication.js file.

Deploying the action

Once you have tested your action, the next step is to deploy it. To do so, run the following command:

wmio deploy

With this, your action will be available for you to use locally. Refresh the browser to see the deployed action added in the Connectors panel under the Services tab.

Error Description

Here is a list of some common errors you might face while deploying the action to your tenant.

Executing the action

The process of executing the action remains the same as that of any other action on webMethods.io Integration.

Prerequisites for executing the action

Before you execute any newly created action, ensure that:

Editing an existing custom action

You can edit an existing custom action created through a Swagger file. To do so, follow the steps given below:

Deleting an existing custom action

You can delete an existing custom action created using a Swagger file. To do so, follow the steps given below:

Help

Given below is the list of all commands used to create a custom action using a Swagger file:

  • npm i @webmethodsio/wmiocli -g: Installs node module to create and deploy connectors on webMethods.io Integration platform
  • wmio login: Configures the deploy key and logs you into webMethods.io Integration
  • wmio init: Initializes a new webMethods.io Integration app in your directory
  • wmio swagger <swagger_file>: Imports all APIcalls from the specified swagger file as actions in the connector
  • wmio auth: Creates an authentication scaffolding in the app directory
  • wmio test: Tests and runs the created custom connectors
  • wmio deploy: Builds app and deploys it to webMethods.io Integration
  • wmio pull: Deletes an existing custom connector
  • How Dynamic Forms work with Google Sheets

    Dynamic Forms make it easier to work with actions that expect data for custom fields. In this tutorial, we will understand how to use Dynamic Forms feature in a Google Sheets action, with the help of an example.

    How it works

    Let’s say, you want to create a workflow that adds a new row to Google Sheets each time a note is created in Evernote. To do this, follow the steps given below:

    1. Add and configure Evernote - New Note trigger.

    2. Drag Google Sheets connector on canvas and connect it to Evernote trigger (Start icon) and Stop icon.

    3. Double-click the Google Sheets connector, and select Add Row action from the Select Action drop down list. Select/add the account for Google Sheets that you want to use to execute this action. Read more about Creating Accounts.

      Once you have specified the account, click Next. You will see the configuration window similar to the one given below:

      • Spreadsheet ID: Select/specify the ID of the spreadsheet in which you want to add a row.

      • Sheet ID: Select/specify the ID of the sheet in which you want to add a row.

      As soon as you specify the Sheet ID, webMethods.io Integration will automatically fetch the headers of all columns of the specified sheet in the configuration window.

      You can then add/enter the relevant values for each of these columns. You can keep a column blank if you don’t want to provide value for it. This makes it easy for you to add rows to your Google Sheets spreadsheets.

      Once you have entered all the required details, click on Next, test the action, and click on Done to return to the canvas.

      Note: As of now, the Dynamic Forms feature has been enabled only for the actions of the Google Sheets application.

    How to Use Account Store, Flow Store, and Memory Store

    webMethods.io Integration allows you to store key-value pairs and fetch them when required during a workflow execution. WebMethods.io Integration provides this functionality with three data store actions, namely, Account Store, Flow Store, and Memory Store. Though all the three data store actions seem to perform the same task, there are certain key differences in their features that make them ideal for different scenarios. Let’s now know exactly what each of these actions do and understand how to use them.

    How to Use Account Store

    The Account Store action lets you store one or more key-value pairs with a global scope and retrieve them during any workflow execution. This means that, each key-value pair you store using the Account Store action can be retrieved while working with any workflow of any project in your tenant. Let’s understand this with the help of an example.

    Let’s say we have two different projects: Default and Recipes. In Default, we will create a workflow to set a key-value pair. Next, we will retrieve the value of this key using the workflow created in the Recipe project.

    Set Key-Value Pairs with Account Store

    1. Add action to canvas

      Add Account Store action on canvas and connect it to the Start and Stop icons as shown below:

    2. Configure the Account Store action

      Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

      • Account Store: Since we want to set a key-value pair, select Set from the drop down field.
      • Key (mandatory): Provide a suitable name for the key you want to set.
      • Value: Enter the value you want to assign to the specified key.
      • You can set as many key-value pairs as you want by clicking on the + button. Once you have entered all the required details, click on Next optionally Test the action (click here to know how), and then click on Done to return to the canvas.

        Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key. If you want to delete the value of an existing key, keep the corresponding value field empty. Once you do that, Save and Run the workflow to delete the data in the value field permanently.

        With this, you have successfully created and stored the key-value pairs. Once you add the key-value pairs, you can fetch them anytime in the future. Let’s now understand how to retrieve values of the stored keys.

    Retrieve Values of Stored Keys from Account Store

    We will now understand how to retrieve the value of stored keys with Account Store action. For this, we will create a workflow in the project named Recipes with Account Store action to retrieve value of a stored key and then post its details on a Slack channel.

    1. Add actions/connectors to canvas:

      Add Account Store action and Slack connector to canvas and connect them as shown below.

      Now that the actions are added to the canvas, the next step is to configure these actions.

    2. Configure Account Store action #403}

      Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

      • Account Store: Since we want to get the value for a stored key, select Get from the drop down field.

      • Key (mandatory): Provide the name of the stored key of which value you want to retrieve. You can fetch values of multiple keys by clicking on the + button.

      Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      Next, configure the Slack - Post New Message action as you would normally do to post what we retrieved earlier on the specified Slack channel.

      Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

    Delete the stored Key-Value pair from Account Store

    webMethods.io Integration allows you to delete stored key-value pairs from the Account Store action.

    Note: As the Account Store action stores key-value pairs with a global scope, you can delete the stored key-value pairs from any workflow of any project in your tenant.

    If you want to delete a stored key-value pair from Account store, simply select Delete from the drop down field, specify the name of the key you want to delete, and then click Next.

    Doing this will successfully delete the key and its associated value from the Account Store action.

    How to Use Flow Store

    The Flow Store action lets you store one or more key-value pairs and retrieve them when required from within the same workflow of the project. This means the keys stored inside a workflow using Flow Store can be retrieved on all subsequent executions of that particular workflow, but they cannot be retrieved outside of that workflow.

    Let’s understand how to set key-value pairs and retrieve their values using the Flow Store action with the help of an example.

    Set Key-Value Pairs with Flow Store

    1. Add action to canvas

      Add Flow Store action on the canvas and connect to the Start and Stop icons as shown below:

      Now that the action is added to the canvas, the next step is to configure the Flow Store action.

    2. Configure the Flow Store action #405}

      Double-click the Flow Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

      • Flow Store: Since we want to set a key-value pair, select Setfrom the drop down field.
      • Key (mandatory): Provide a suitable name for the key you want to set.
      • Value: Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.
      • Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key.

        Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

        With this, you have successfully created and stored the key-value pair(s). Once you have created and stored the key-value pairs, you can retrieve them from the same workflow. Let’s now understand how to get or retrieve values of the stored keys.

    Retrieve Values of Stored Keys with Flow Store

    To get or retrieve values of the stored keys, we will have to add the Flow Store action in the same workflow where we had stored and then post its details on a Slack channel.

    1. Add actions/connectors to the canvas Add Flow Store and Slack action on the canvas and connect to the Start and Stop icons as shown below:

      Now that the actions are added, the next step is to configure these actions.

    2. Configure the Flow Store action #406}

      Double-click the Flow store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

      • Flow Store: Since we want to get the value for a stored key, select Get from the drop down field.

      • Key (mandatory): Provide the name of the stored key of which value you want to retrieve. You can fetch the value of multiple stored keys by clicking on the + button.

      Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      Next, configure the Slack - Post New Message action as you would normally do to post the key value details we retrieved earlier on the specified Slack channel.

      Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

      Note: If you store value for a particular key in a workflow within a project and try to retrieve its value in another workflow within the same project, the workflow will not successfully execute.

    Delete the stored Key-Value pair from Flow Store

    webMethods.io Integration allows you to delete stored key-value pairs from the Flow Store action.

    Note: As the Flow Store action lets you store one or more key-value pairs and retrieve from within the same workflow of the project, you can only delete the stored key-value pairs from that same workflow of that particular project.

    If you want to delete a stored key-value pair from the Flow store, simply select Delete from the drop down field, specify the name of the key you want to delete, and then click Next.

    Doing this will successfully delete the key and its associated value from the Flow Store action.

    How to Use Memory Store

    The Memory Store action lets you store and retrieve one or more key-value pairs which is limited to only single workflow run. This means that the keys stored inside a workflow using Memory Store remain active for only one execution. On the subsequent execution of the same workflow, you cannot retrieve the keys stored in the previous execution. So, if you want to set key-value pairs and get the values of stored keys in the same workflow, you will have to add two Memory Store actions in the same workflow.

    Note: While Flow Store and Memory Store both let you set and retrieve keys from within the same workflow only, Flow Store lets you retrieve the keys on all subsequent executions of that workflow whereas Memory Store lets you retrieve the keys on only first execution of that workflow.

    Let’s now understand how to set key-value pairs and retrieve the values using the Memory Store action with the help of an example. Let’s say, we have a workflow that sets a key-value pair, get the values for the stored key, and post the value details on the specified Slack channel.

    Set Key-Value Pairs and Retrieve Values of Stored Keys with Memory Store

    1. Add actions/connectors to canvas

      Add two Memory Store actions, one for setting key-value pairs and another one for retrieving values of stored keys, to the canvas, along with the Slack connector. Connect these actions and connector to the Start and Stop icons as shown below:

    2. Configure Memory Store action for Setting Key-Value Pairs

      Double-click the first Memory store action icon to Set key-value pairs. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

      • Memory Store: Since we want to set a key-value pair, select Set from the drop down field.

      • Key (mandatory): Provide a suitable name for the key you want to set.

      • Value: Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.

      Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      With this, you have successfully created and stored the key-value pairs.

    3. Configure the Memory Store action for retrieving values for stored keys

      Double-click the second Memory Store action icon to Get value details of the stored key. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

      • Memory Store: Since we want to get the value for a stored key, select Get from the drop down field.

      • Key (mandatory): Provide a suitable name of the stored key of which value you want to retrieve. You can retrieve the value of multiple stored keys by clicking the + button.

      Once this is done, click Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      Next, configure the Slack - Post New Message action as you would normally do, to post the key value details we retrieved earlier on the specified Slack channel.

      Once this is done, Save the workflow. Now, when you Run the workflow, you will get the value details on the specified Slack channel. If you try to execute this workflow again however, you will not get the desired result, as each Memory Store action is limited to one workflow run only.

    Delete the stored Key-Value pair from Memory Store

    webMethods.io Integration allows you to delete stored key-value pairs from the Memory Store action.

    Note: As the Memory Store action is limited to only a single workflow run, the keys stored inside a workflow remain active for only one execution. So, if you want to delete a key-value pair, then you will have to add two Memory Store actions in the same workflow in the canvas, one for setting key-value pairs and another one for deleting key-value pairs.

    To configure the second Memory Store action, simply select Delete from the drop down field, specify the name of the key you want to delete, and then click Next.

    Doing this will successfully delete the key and its associated value from the Memory Store action.

    How Return Data on Sync Webhook works

    The Return Data on Sync Webhook action enables you to run a workflow by calling a URL (webhook URL) and get the workflow’s output in the body of the URL.

    We will understand how this action works with the help of an example.

    Example

    Let’s say, you have a workflow that creates a board in your Trello account, posts the details of the board on the specified Slack channel, and also sends board details via Email

    Once all the actions have been configured and connected, double-click the Start icon. A new screen will appear containing a list of trigger services. Select Webhook trigger from the list.

    On clicking the Webhook trigger, a unique webhook URL will be generated. You can optionally add an extra layer of security to your webhook URL by enabling the webhook authentication option. Click on Next and then on Done to go back to the canvas.

    At this point, if you hit this webhook URL in any browser, the workflow will get executed automatically, and you will receive the following response in the browser window:

    Now, drag and dropReturn Data on Sync Webhook as the last action of your workflow. In our example, we will add the action after the Send an email action as shown in the image below:

    Configure the Return Data on Sync Webhook action and insert values in the given fields as per the instructions given below:

    Once you have added this action to your workflow, ‘?sync=true’ will be automatically appended to your webhook URL as shown in the image below.

    The ‘Return Data on Sync Webhook’ will sync the workflow with webhook URL and will send the workflow output to it when the Webhook URL is hit.

    Notes:

    • When you enable ‘Return Data on Sync Webhook’ for your webhook, it expects a response within 180 seconds after the triggering event. If the response is not received within the specified period, the ‘408 Request Timeout’ error will be thrown. This error means the server chooses to terminate the connection rather than continue waiting for the response.
    • However, if you are using any other web browsers, like Google Chrome, Microsoft Edge, etc., other than Mozilla Firefox, you may observe automatic retries performed by the browser before getting the ‘408 Request Timeout’ error. This means, your browser is automatically making multiple requests to get a response, and hence, you may have to wait for more than 180 seconds before you see the ‘408 Request Timeout’ error.
    • If you are using services like Postman, and the response is not received within 180 seconds, the ‘408 Request Timeout’ error will appear soon after the timeout duration.

    Now when the Webhook URL is hit, you can see the required board details on the screen.

    How to add rows to an existing Smartsheet

    You can add rows to an existing Smartsheet by using Smartsheet - Add Rows action. Follow the steps to achieve this.

    How it works

    1. Add the Smartsheet connector to canvas and connect it to Start icon.

    2. Double-click the Smartsheet connector, and select Add Rows action from the Select Action drop down list. Read more about Creating accounts.

    3. Select/add the account for Smartsheets that you want to use to execute this action.

    4. Once this is done, click Next, and the following details in the action configuration window that appears next:

      • Sheet ID: Select/specify the ID of the sheet in which you want to add rows.

      • Row Location (Mandatory): Select the location where you want to add a row from the options given under the drop-down list. If you select Child of Parent option, you have to enter the Parent ID , and if you select Sibling , you have to enter the Sibling ID .

      Note: Child of Parent adds a new row as a child of the specified row and Sibling adds a new row at the same hierarchical level of the specified row.

      • Parent ID: Select the ID of the parent row. The new row is added as the first child of this parent row.

      • Insert Row in the Child List At: Select the position of the row you want to add.

      You add multiple rows and columns by clicking on the ADD link.

    5. Once you have entered the relevant details, click Next, test the action, and click Done.

      This will take you back to canvas.

    6. Next, Save the workflow and click Test.

      This will add a new row (along with the value, if any) at the specified location. Please note that to see the reflected changes, you will need to refresh the selected sheet in Smartsheet.

    How to Create Custom OAuths for Google Connectors

    webMethods.io Integration lets you create custom OAuths for the supported Google connectors. This custom OAuths can then be used to configure supported triggers and actions.

    When you are configuring an action or a trigger, you are prompted to select an existing account or create a new account. To create custom OAuth, click the + icon located beside the Authorize {connector_name} label. You will be redirected to the screen given below:

    Here, you need to enter the relevant details associated with your Google service account to create custom OAuth.

    Retrieving Client ID and Client Secret

    You need to have a relevant Google connector app in Google Cloud Platform to retrieve its Client ID and Client Secret. We will first understand how to create an app for a Google Connector (if you have already created an app, skip to step 4).

    Let’s say you want to create an app for Dialogflow. To do this, follow the steps given below:

    1. Login to Google Cloud Platform and create a new project

      First, login to Google Cloud Platform. You will be prompted to create a new project.

      Once you have entered the relevant details, click Create. This will redirect you to the project dashboard.

    2. Enable service APIs

      Click on the + ENABLE APIS AND SERVICES button.

      This will take you to the Google API library where you can view a list of all services supported by Google.

      Click the service for which you want to create an app.

      This will set up the selected service API in your account. Click on Enable to enable it for your account.

    3. Set up OAuth Client ID

      Once the API is enabled, you will be redirected to the API dashboard.

      Click on the Credentials menu listed in the left-side panel, and then select the OAuth Client ID option from the CREATE CREDENTIALS dropdown menu.

      You will be prompted to Configure the consent screen details. To do so, click the Configure consent screen button.

      This will take you to OAuth Consent screen screen where you need to provide the following details:

      • Application type: Specify whether you want to create a public or private application.

      • Application name: Provide a suitable name for your application.

      • Authorized domains: Enter the domain(s) for which you want to enable OAuth access.

      Once this is done, click Save.

      Set Application type to Web in the next screen that appears and specify the redirect URL in the Authorized redirect URIs field.

      Note: The redirect URI should match with the domain(s) you have specified in the previous screen.

      Once this is done, click Create. With this, your app will be successfully created.

    4. Retrieve Client ID and Client Secret

      As soon as the app is created, you will see the Client ID and Client Secret in the pop-up window.

      You can alternatively view the Client ID and Client Secret by navigating to relevant project dashboard, and clicking the Credentials menu listed in the left-side panel.

      You will see the list of all existing OAuths clients.

      Locate the OAuth client of which Client ID and Client Secret keys you want to retrieve, and click on the Edit OAuth Client icon given against it.

      This will take you to the OAuth Client configuration screen where you can see the Client ID and Client secret for the selected app at the top of the page.

      Copy the Client ID and Client Secret from here and add them to the respective fields in the Add Account window.

    Retrieving Access Token and Request Token

    You can use services like Postman to retrieve the Access Token and Request Token. To do this, you need to perform two steps where you make two API requests to relevant Google service.

    1. Retrieve authorization code required to fetch access token and request token.

      Open Postman and set up the first request as given below:

      Key Value
      client_id {Enter client_id}
      redirect_uri {Enter redirect_uri}
      response_type code
      scope {Enter relevant scope from this list}
      include_granted_scopes true
      state pass through value
      prompt consent
      access_type offline

      Once this is done, you will notice that the params passed by you are appended to the request URL. Copy this modified request URL, paste it in any browser, and hit enter.

      You will be prompted to select the Gmail account you want to use. Once you do this, you will see the consent screen for the app created by you.

      Click Allow. This will take you to the homepage of your app. Copy the value of the code key displayed in the address bar and save it in any text editor. We will need this key in the next step when we send the request to retrieve the Access Token and Request Token.

    2. Retrieve Access Token and Refresh Token

      Open Postman and set up the second request as given below:

      Key Value
      client_id {Enter client_id}
      redirect_secret {Enter client_secret}
      redirect_uri {Enter redirect_uri}
      grant_type authorization_code
      code {code retrieved from step 1}

      Once you have entered all the details, click Send. This will return the Access Token and Request Token along with other details in the Body tab of the response.

      Copy the Access Token and Request Token from here and add them to the respective fields in the Add Account window.

      Note: The value of Refresh URL will always be https://www.googleapis.com/oauth2/v4/token and the value of Grant Type will always be refresh_token for all Google connectors.

    List of Scopes for Google Services

    Table given below contains the scope(s) to be used while sending the first request in order to retrieve the Access Token and Refresh Token.

    Note: Use space separator in case of multiple scopes.

    Service Name Scope(s)
    Gmail https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.compose
    Dialogflow https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/dialogflow
    Google Contacts https://www.google.com/m8/feeds
    https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Forms https://spreadsheets.google.com/feeds
    https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive.readonly
    Google Tasks https://www.googleapis.com/auth/tasks
    https://www.googleapis.com/auth/tasks.readonly https://www.googleapis.com/auth/taskqueue.consumer https://www.googleapis.com/auth/taskqueue https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Sheets https://spreadsheets.google.com/feeds/
    https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive.readonly
    Google Drive https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.file
    https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.apps.readonly https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Calendar https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Apps Admin https://www.googleapis.com/auth/admin.directory.device.mobile https://www.googleapis.com/auth/admin.directory.device.mobile.readonly https://www.googleapis.com/auth/admin.directory.device.mobile.action https://www.googleapis.com/auth/admin.directory.group.member https://www.googleapis.com/auth/admin.directory.group.member.readonly https://www.googleapis.com/auth/admin.directory.group https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.orgunit https://www.googleapis.com/auth/admin.directory.orgunit.readonly https://www.googleapis.com/auth/admin.directory.user https://www.googleapis.com/auth/admin.directory.user.readonly https://www.googleapis.com/auth/admin.directory.user.alias https://www.googleapis.com/auth/admin.directory.user.alias.readonly https://www.googleapis.com/auth/admin.directory.user.security https://www.googleapis.com/auth/admin.directory.rolemanagement https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly https://www.googleapis.com/auth/admin.directory.userschema https://www.googleapis.com/auth/admin.directory.userschema.readonly https://www.googleapis.com/auth/admin.directory.notifications https://www.googleapis.com/auth/admin.directory.customer https://www.googleapis.com/auth/admin.directory.customer.readonly https://www.googleapis.com/auth/admin.directory.domain https://www.googleapis.com/auth/admin.directory.domain.readonly https://www.googleapis.com/auth/admin.directory.resource.calendar https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly https://www.googleapis.com/auth/admin.directory.device.chromeos https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly
    Google Analytics https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.edit https://www.googleapis.com/auth/analytics.manage.users https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Cloud PubSub https://www.googleapis.com/auth/pubsub
    https://www.googleapis.com/auth/cloud-platform
    Google Analytics Reporting https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.edit https://www.googleapis.com/auth/analytics.manage.users https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google BigQuery https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/bigquery.readonly https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/devstorage.read_write https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    Google Translator https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
    https://www.googleapis.com/auth/cloud-translation
    https://www.googleapis.com/auth/cloud-platform
    Google Cloud Storage https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/devstorage.read_write https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile

    How to read the contents of a downloaded file

    When you download any file using Google Drive, Dropbox, or other such applications, it is saved temporarily in the webMethods.io Integration engine local storage. In order to read/access this file, you need to use other online file storage applications where this file can be uploaded. Let’s understand how it works with the help of an example.

    Suppose you need to download a file using Google Drive and read it. To do this, follow the steps given below:

    Configure the Google Drive-Download File by ID action

    1. Add the Google Drive connector to canvas, connect it to the Start icon, and double-click the connector icon. This will open the configuration window where you can select the action you want to use.

      • Select Action: For the purpose of this tutorial, select the downloadFileById action from the drop down list. This will populate the below two fields:

      • Name: Provide a label for the action you want to configure.

      • Authorize Google Drive: Select the account you want to use to execute the action, from the drop‐down list. If you have not created an account yet, click on the + button. You will see two options:

        • Default Authorization: Select this option to allow webMethods.io Integration to automatically generate all keys required to execute all Google Drive actions.
        • Or: Select this option to provide the relevant keys required to execute all Google Drive actions.
        • Select one of the options, provide the required information as prompted on the screen, and click Add.
        • This will create a new account for your Google Drive account. Once you create an account, you can use it to execute all other Google Drive actions and triggers.
    2. Once this is done, click Next, test the action, and click Done.

      At this stage, if you run the workflow, the specified file will be downloaded to webMethods.io Integration engine local storage. To read/access this file, use Dropbox Download file action (or any other similar action of a cloud storage application).

    Configure the Dropbox-Upload File action

    1. Add Dropbox connector to canvas, connect it to the Google Drive connector, and double-click the Dropbox connector.

    2. Select the Upload File action, provide a label for action, and add or select the account you want to use to execute the action, just like we did for Google Drive.

    3. Once you have entered all the details, click NEXT, test the action, and click Done

    Save and run the workflow

    Connect the Dropbox application icon with the Stop icon, Save the workflow, and click on Test.

    This will download the specified file from your Google Drive account and upload it to the specified folder in Dropbox, where you can read the file.

    How to get data from the action and push it to another...

    The output of the first action can be used as an input for another action by using the keys given on the left-side of the configuration window. Let’s see how to do this with the help of an example.

    In this example workflow, we will fetch the details of a particular campaign from your Marketo account, and use those details to create a new campaign in your Salesforce account.

    Add Actions

    1. To do this, add Marketo and Salesforce connectors to your webMethods.io Integration canvas, and connect them in the order shown below:

    Use Output

    1. Configure the Marketo-getLeadById action

      Double click the Marketo connector icon and select the getLeadByIdaction from the Select Action drop down list. When you do this, two more fields will be populated in the window.

      Provide the name for the action and select/add the account for Marketo , and click Next.

      Select/specify the ID of the campaign that you want to fetch in the Campaign ID field.

      Once this is done, click Next and test the action by clicking on the Test button.

      This serves two purposes: First, it checks whether the action has been configured properly or not, and second, it fetches the details of the latest campaign and displays it in the output tab.

      Once this is done, click Done to return to the canvas.

    2. Configure the Salesforce - createLeads action

      We will now configure the Salesforce — createLeads action. To do so, double-click the Salesforce connector icon, select the Create Campaign action in the window that appears, and select the appropriate Salesforce account you want to use to execute the action. Once this is done, click Next.

      Here, you can see the output data of the Marketo — getLeadById action on the left-side of the screen. This output data includes output keys returned by the action output. You can use these keys to provide inputs for the Salesforce - Create Leads action.

    Similar Instances

    Similarly, you can add other details of the campaign, such as company and city

    Once you are done with this, click Next.

    You can now optionally test the configured action by clicking Test or go back to canvas by clicking Done.

    Now, when you Save and Test this workflow, webMethods.io Integration will then automatically fetch the details of the specified Marketo campaign and, using those details, create a new Salesforce campaign.

    How to retrieve the value of a custom field

    There are some applications that let you create custom fields while creating objects or records. When you integrate webMethods.io Integration with such applications, it provides a Custom Fields block that lets you pass values for the specified custom fields. In this guide, we will understand how to retrieve the values of these custom fields.

    Let’s say you want to retrieve the name (form field) and address (custom field) of a particular attendee of your EventMobi account, and send it to a specific recipient by email. To do this, follow the steps given below:

    Add actions

    1. Add EventMobi connector and Send an Email action on canvas and connect them as shown below:

    Configure Get Attendee Details action

    1. Double-click the EventMobi application icon, select the Get Attendee Details action and add or create the EventMobi account you want to use to execute the action.

    2. Double-click the EventMobi application icon, select the Get Attendee Details action and add or create the EventMobi account you want to use to execute the action.

    3. Once this is done, click Next.

      Here, you will see the action configuration form. Provide the values for the form input fields as instructed below:

      • Event Shortcode: Enter the event shortcode. If your event app URL is eventmobi.com/sample123, then sample123 will be the event shortcode.

      • Attendee ID: Select/specify the ID of the attendee whose name and address details you want to retrieve.

    4. Once you have entered the details, click Next, test the action (optional), and click on Done. This will take you back to the canvas.

    Configure Send an Email action

    Configure the Send an Email action. To do so, double-click theSend an Email action and click Next. In the action configuration window that appears, provide values for the following fields:

    First, click on the first_name key given on the left-hand side of the configuration window under Get Attendee Details output parameters. This will retrieve the name of the attendee.

    The next parameter we need (i.e., Address key) is defined as a custom field and hence will be listed under the custom_fields_values key of Get Attendee Details

    Locate the custom_fields_values key and click on the + icon given beside it to expand it. You will see a list of properties for the specified custom field. Since we need just the value of the custom field, click on the value key. This will retrieve the address of the attendee.

    Once you have entered the details, click Next, test the action, and click Done to return on the canvas. Then, click the Test button located at the top-right corner of the canvas to run the workflow. This will retrieve the name and address of the specified attendee from your EventMobi account and will send it to the specified recipient through via Gmail.

    Note: In case you have defined more than one custom field, then you can retrieve the values of multiple custom fields, by simply changing the index value of the parameter. so, for instance, if you have defined three customs fields, then the index value of the first custom field will be 0, the index value of the second custom field will be 1, and the index value of the third custom field will be 2

    The parameters to be passed to retrieve the values of first and second custom fields are \{\{$a23.custom\_fields\_values\[0\].value\}\} and \{\{$a23.custom\_fields\_values\[1\].value\}\}.

    How to fetch the PagerDuty incident details and post them on Cisco Webex Teams space and Slack channel

    You can fetch the details of the incoming PagerDuty incidents and instantly post them on Cisco Webex Teams space and Slack channel.

    How it works

    To do this, follow the steps given below:

    1. Add and configure the PagerDuty - New Incident trigger as instructed below:

      • Trigger Label: Enter a suitable name for the trigger.

      • Select Trigger: Select New Incident trigger from the options available in the drop-down list. This instructs the webMethods.io Integration to trigger the workflow whenever a new incident is added in a particular service in your PagerDuty account.

      • Authorize PagerDuty: In order to use this trigger, you will have to first create PagerDuty account. Click the + button, and create your account using either Default Authorization option or service access token (i.e., Or option). If you have already created an account, select it from the drop-down list.

      • Service ID: Select/specify the ID of the service for which the trigger is to be set. In PagerDuty, the service ID could be found in the URL of the service. E.g.: PQQB1HE

      Once you have entered the details, click Done. This will take you back to canvas.

    2. Add Cisco Webex Teams connector to the canvas and connect it to the PagerDuty trigger.

      Double-click the Cisco Webex Teams connector icon, select the Post New Message action from the Select Action drop down list, and select the Cisco Webex Teams account you want to use to execute the action.

      Once this is done, click Next. In the action configuration form that appears next, provide the details as given below:

      • Space ID: Select/specify the ID of the space on which you want to post the message.

      • Message: Specify the message that you want to post in the space. In this case, we will enter a custom message, along with the output of the PagerDuty trigger.

      Once you have entered the details, click Done. This will take you back to canvas.

    3. Add Slack connector to the canvas and connect it to the PagerDuty trigger.

      Next, double-click the Slack connector icon, select the chatPostMessage action from the Select Action drop down list, and select the Slack account you want to use to execute the action. Once this is done, click Next.

      In the action configuration form that appears next, provide the details as given below:

      • channel: Enter the ID of the channel on which you want to post the message.

      • text: Specify the message that you want to send to the channel. In this case, we will enter a custom message, along with the output of the PagerDuty trigger.

      Once you have entered all the details, click the Next button, Test the action, and click the Done button to return to the canvas.

    4. Connect the Cisco Webex Teams and Slack connectors to the Stop icon and Save the workflow.

      Now, whenever a new incident is triggered in the specified service in PagerDuty, this workflow will send the incident details to the specified Cisco Webex Teams space and Slack channel.

    How to change the state of a Nest thermostat

    You can remotely change the state of your Nest thermostat with webMethod.io Integration platform.

    Let’s understand how to do it with the help of an example.

    How it works

    Let’s say, you want to create a workflow that sets the state of your Nest thermostat to home at 6 PM everyday. To do this, follow the steps given below:

    1. Add and configure the Clock trigger as shown below:

      • Trigger Label: Enter a suitable name for the trigger.

      • Trigger type: Select the Repeat From option from the drop-down list. This instructs the trigger to repeat at regular intervals, starting from the specified date and time.

      • Date: Select the date from which you want to start the repeat trigger.

      • Time: Enter the time from which you want to start the repeat trigger. For the purpose of this workflow, we will set it to 6 PM. (18:00).

      • Timezone: Select the timezone for the trigger start time.

      • Runs on every: Select the trigger interval. The trigger will be fired off every time after the interval specified here. Since we need to get the temperature every day, select 1 Day from the drop-down list.

      Once you have entered the details, click Done. This will take you back to canvas.

    2. Add Nest connector to the canvas and connect it to the Clock trigger.

      Next, double-click the Nest connector icon, select the Set State of Structureaction from the Select Action drop down list, and select the Nest account you want to use to execute the action.

      Once this is done, click Next.

      In the action configuration form that appears next, provide the details as given below:

      • Set State: Set the state to home. This action will ensure that the state is changed to home when the clock triggers off at a specified time.

    3. Once you have entered all the details, click the Next button, Test the action, and click the Done button to return to the canvas. Connect this action to the Stop icon and Save the workflow. Now, every day at 6 PM, this integration will be triggered. As a result, it will set the state of your Nest thermostat from away to home.

    How to use Swagger Action

    WebMethods.io Integration lets you access the APIs and make API calls of any service that is built either using RAML or Swagger. The integration platform provides this novel functionality with action - Swagger.

    In this guide, we will help you understand how to use Swagger.

    How to use Swagger

    The Swagger action lets you access the APIs and make API calls to any service that is built using Swagger. In essence, this action lets you create a custom action form by simply entering a JSON file.

    1. Add the Swagger action to the canvas as shown below.

    2. Double-click on the Swagger action, you will see a window appearing on the screen. In the Swagger File URL field, enter the URL for the swagger JSON file of the service you want to get the APIs of, optionally enter the service account credentials, and click on the ‘Fetch’ button. 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 credentials and click on Fetch. (Petstore is a sample Swagger JSON).

    3. A new Select an API field will be automatically added to the form. Select the API you want to execute and then click on Next.

    4. Once you have selected an API, the API form will automatically display all the mandatory as well as optional fields of the selected API call.

    5. Enter relevant data in the fields, and click on Done to return to your canvas. Now, when you test the workflow with this action, the selected API call will be executed.

    How to execute a FlowService with an XML input

    In this tutorial, let’s see the additional steps required to support the XML input for the FlowServices and generate an XML output using the below examples:

    Accept XML as input for FlowService

    1. Create the FlowService.

    2. Click the icon and define the input field node with type as Object as shown below.

      When an XML input is provided to any service for execution, webMethods.io Integration converts the XML input to XML node and sends the XML node to the service for execution.

    3. Select xmlNodeToDocument service to convert XML node to a document.

    4. Use math service AddInts to perform mathematical operations on string-based numeric values.

    5. Now, the pipeline will have two fields node and document.

    6. Add required fields under the document and map it to the AddInts service.

      This groups the elements under the document field.

    Sending XML output from FlowService

    1. Add Transform Pipeline to group the variables that you want to send in a response and drop all unwanted variables.

    2. Next, use the documentToXMLString service to convert the response document to XML String.

    3. Select the Flow function and then select the SetHttpResponse service to set the HTTP response to success or failure along with the response XML.

      Map the XML string to response string and set the response code as required.

    4. On the Overview page, select the Enable FlowService to be invoked over HTTP option. Once the FlowService is enabled to be invoked over HTTP, the HTTP request URL appears.

    5. Download the Postman app (Windows 64-bit) from https://www.postman.com/downloads, install the app, and then sign-in to Postman.

    6. On the Postman page, click Create a request.

      Invoking a service from Postman page appears as shown below: