1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Develop
  5. Simple Tasks
  6. Action Tasks
  7. Action Task: API Request (SOAP)

Action Task: API Request (SOAP)

After you describe the Bot action task on the General tab, and if required, define authentication requirements on the API Request tab, you are ready to start configuring the API request that asks for data from your Bot website, system, or web application for the task. This topic describes how to configure the request object for an action task with the Connection Mode set to SOAP.

To define a task web service request object with Connection Mode set to REST, see API Request Tab – Action Task – REST.

Configuring API Request (SOAP)

For an action task request in Kore.ai and the Connection Mode set to SOAP, you need to define:

  • Authentication – If required for your action task, you need to define the authentication to access the API, for example, using basic authorization, OAuth, or API Key. For more information, see API Request Tab – Authentication Settings for an Action Task.
  • WSDL URL – Define the URL that contains your WSDL data. When the URL is retrieved, you can choose from a list of available operations based on the WSDL, and then customize the user input fields. For more information, see Defining the WSDL URL.
  • Access Using a connector – Specify if your Bots Platform is installed on-premise and if you want to user the Kore.ai Connector agent. For more information, see Access Using a Connector.
  • Response Sample – Define key-value pairs that you expect to receive in the Action task payload. The key-value pairs that you provide are available as drop-down choices for handling the data to display to the end-user. For more information, see Adding a Response Sample for an Action Task.

The following illustration is an example of the API Request tab on the Edit Action – < Task Name > page for an action task with the Connection Type specified as Webservice and the Connection Mode that is defined on the General tab is set to set to SOAP.

Defining the WSDL URL

  1. On the API Request tab, expand the WSDL URL section
  2. To begin the request task configuration for a SOAP request, enter the URL for your SOAP WSDL in the WSDL URL field.

  3. Click Get WSDL Description. A list of available operators defined in the WSDL opens.
  4. Click Select for the SOAP request that you want to use for your task. Kore.ai will automatically populate one or more Action Task Fields if necessary for user input.

Customizing SOAP Action Task Fields

You can customize the default input fields provided by Kore.ai after you select one or more of the available operations from your WSDL.

To customize the default Action Task Fields, follow these steps:

  1. Click Edit for the Action Task Field that you want to customize. The Setup Action Task Field dialog opens.
  2. To define the end-user fields to collect input, specify the values for the parameters in the Setup Action Task Field dialog as described in the following table.
    Field NameDescription
    Field TitleThe title of the task input field displayed in the end-user interface, for example, Country.
    Help HintThe help text displayed below the task setting title to describe the task, for example, Enter the Country Name you want the Weather for..
    Field KeyA read-only key that represents the end-user input value that you want to collect, for example, country.
    Field Type

    Specifies the type of task input field displayed in the end-user interface to collect user input for the request object to assign to the Key value. The default setting is Textbox, but can be customized to any one of the following:

    • Date – Displays the Format field where you can select the date format syntax for the end-user to define when the task is configured for their account. In the Select Date Format drop-down list, select one of the following:
      • dd-MM-YYYY – For example, 16-05-1999
      • MM-dd-YYYY – For example, 05-16-1999
      • dd-MM-YY – For example, 16-05-99
      • YYYY-MM-dd – For example, 1999-05-16
    • URL – Displays a text box for the end-user to enter a URL including field validation for a correct URL syntax. In the Placeholder field, enter the help hint displayed in the text box, for example, Enter the URL for the website here.
    • Textbox – Displays a text box for the end-user to enter text as the task input field, typically just a few words. In the Placeholder field, enter the help hint displayed in the text field, for example, Type in the name you want to embroider.
    • Static Dropdown – Displays a drop-down list of choices to the end-user. Click Add Option to begin adding the list of items to display to the end-user with the following parameters:
      • Option Name – The name of the option displayed to the end-user.
      • Option Value – The value the represents the Option Name returned to the application.
      • Default Value – Select the default value for the option when more than one option is defined.
      • Searchable – Select to enable dynamic search and display as the end-user enters text in this field, or if no matches, allow free-form entry.

      Click Save. To add additional items, click Add Option again. Edit or remove options in the Actions column for options.

    • Dynamic Dropdown – Displays a drop-down list dynamically populated at runtime based on the response from a URL for your Bot, for example, a list of projects for a JIRA task notification. Define the following properties for a dynamically populated dropdown.
      • Endpoint URL – The Bot endpoint URL, for example, https://app.asana.com/api/1.0/workspaces.
      • Endpoint Content Type – The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, URL Encoded JSON, CCV, Text, or Twitter Encoded JSON.
      • Endpoint Method – One of:
        • GET – Specifies an HTTP Request GET method for the task field.
        • POST – Specifies an HTTP Request POST method for the task field.
      • Response Path – The path in the response that contains the desired drop-down list values, for example, data.
      • Label Key – The key for the label of the drop-down option, for example, name.
      • Option Value Key – The key for the value of the drop-down option, for example, id.
      • Add Payload Field – Click to add one or more fields from the response payload as options for the dynamic dropdown. For each payload field, enter the Payload field key and the Payload field value, and then click Save. Edit or delete payload fields in the Actions column.
      • Searchable – Select to enable dynamic search and display as the end-user enters text in this field, or if no matches, allow free-form entry.
    • Textarea – Displays a text area box for the end-user to enter text as the task input, typically for several sentences. In the Placeholder field, enter the help hint displayed inside the text area.
    • Type Ahead – Displays a dynamically populated drop-down list of choices to the end-user at runtime when the user enters three or more characters that match the search results based on the response from the URL defined for the task. For example, a list of projects for a JIRA task notification message. Define the following properties for a dynamically populated drop-down.
      • Endpoint URL – The Bot endpoint URL, for example, https://app.asana.com/api/1.0/workspaces.
      • Endpoint Content Type – The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, URL Encoded JSON, CCV, Text, Twitter Encoded JSON, Multipart/Form-data, or Multipart/Related.
      • Endpoint Method – One of:
        • GET – Specifies an HTTP Request GET method for the task field.
        • POST – Specifies an HTTP Request POST method for the task field.
      • Response Path – The path in the response that contains the desired drop-down list values, for example, data.
      • Label Key – The key for the label of the drop-down option, for example, name.
      • Option Value Key – The key for the value of the drop-down option, for example, id.
      • Add Payload Field – Click to add one or more fields from the response payload as options for the type ahead field. For each type ahead field option, enter the Payload field key and the Payload field value, and then click Save. Edit or delete payload fields in the Actions column.
      • Editable – Enables the end-user to enter text free-from in the field as an option when type-ahead search results do not match.
    • Email – Displays a text box for the end-user to input an email address. In the Placeholder field, enter the help hint to display to the end-user inside the text box.
    • Date & Time – Displays a text box for the end-user to input a date with time. In the Format field, enter the expected date or time format to display to the end-user in the date text box. In the Select Date Format drop-down list, select the date with time format.
    • Time Zone – Displays a drop-down list of time zones based on the operating system settings.
    • Location – Displays a text box for the end-user to enter a geographical location, for example, Orlando, FL, or 32801.
    • Nested Form – Displays end-user input fields in a nested format below the parent input field. Specify the following fields for a nested form input field:
      • Array Element Type – Select the data type of the parent input form element.
      • Add Nested Form Field – Click to add one or more nested form fields.
    • File Upload – Displays end-user control to search for, and select a file to upload. When clicked, enter the File Upload Payload Key. When the File Upload Payload Key is defined, in the File Upload Payload Field Value drop-down list, select one of the following types:
      • File Name
      • File Size
      • File Content Type
    Data Type

    Select one of these user input types:

    • String – Users can input any sequence of numbers, letters, or special characters.
    • Number – Users can input a number. No special characters are allowed.
    • Boolean – User can input a Boolean value of true or false.
    • Email – User can input a valid email address.
    • Object – Data from a Bot can be received as JSON objects, for example, as location details defined as:
       “location” : {
                     “lat” : 17.4374614,
                     “lng” : 78.4482878
                  }
      where you can refer to the properties in a request chain or task request as location.lat, and location.lng.
    • Array – Users can pass a comma-separated list of values to the Bot. For example, in Google Calendar, multiple attendees with data can be passed as:
      “attendees”: [“user1”, “user2”, “user3”] When selected, specify the Type for the array of end-user input as one of:

      • String
      • Number
      • Boolean
      • Email
      • Array
      • Date
    • Date – Users can type a complete date or select it from a date picker.
    PlaceholderThe text displayed below the input textbox to help the user define the field. This field is only displayed for some Field Types.
    VisibilitySpecify if the task input field should be visible or hidden from the end-user.

    The Visibility field can also be set to Custom field where data is captured from the user but not used as a query parameter or payload field. For example, with a JIRA bot, posting a comment on a ticket using an @mention tag as shown below:

    "@Mike, please look into this issue"

    The JIRA API to Post a comment requires one query field and one payload field as:

    • Issue ID

    • Comment


    With the Visibility field set to Custom, you can capture the user information for the user mentioned as @Mike using the JIRA API to fetch data to append to the comment field value, but not to use as payload field or query field.

    The default Visibility field setting is Visible.
    MandatorySelect if the end-user must define this setting to save the task settings configuration.
    Untranspose the Key

    Select to disable key transposition by Kore.ai. By default, Kore.ai transposes a key/value pair, for example, "parameter":"value" is transposed by Kore.ai to "parameter:{value:"actualValue"}. When selected, keys are not transposed by Kore.ai and passed in the response as received.

  3. Click Add & Continue to save the task field and create another Action Task Field. Or, click Add & Exit to save the Action Task Field and then close the dialog.

Access Using a Connector

To get started with defining access using a connector for a task, follow these steps:

  1. On the API Request tab, expand the Access using a connector section.
  2. In the Access Using A Connector field, select Yes to enable access for Kore.ai Bots using the Kore.ai Connector agent. This option is only visible if a Kore.ai Connector agent is configured and enabled in your enterprise on-premises network. For more information, see Using the Kore.ai Connector.

Adding a Response Sample

In the Response Sample section, you can enter or paste examples of the key-value pairs that you expect to receive in the task payload. When you define the response sample, the keys specified in the Response Sample section are available as drop-down choices for handling the output data.

Adding the Sample Response

  1. On the API Request tab, Expand the Sample Response section.
  2. Enter your Response Sample that contains the key-value pairs from your JSON response payload. Do one of the following:
    • To format the view of the response as a JSON structure with indentation as shown in the following illustration, click the Formatted  icon.
    • To format the view of the response in serialized compact form as shown in the following illustration, click the Unformatted  icon.

Next Steps

After you finish defining your API request, you are ready to define the message displayed to the end-user. For more information, see Defining the Bot Response for an Action Task.

Was this article helpful to you? Yes No