Workflow

To exchange data from the dialog application:

  1. Configure the base URL of the web service.
  2. Configure the data to exchange in the data access node.
  3. Build and deploy the dialog application.
  4. If latency messages are configured, handle them in the client application.

Configure base URL of web service in the dashboard

The External Resources tab lists the web services that are defined for a project. Server-side integration requires that the dialog runtime application has access to the backend server, so the URL of a web service may differ per environment.

The External Resources tab lets you specify an alias name to identify the web service, and you can set different URLs for this alias according to the environment, as appropriate.

By default, the External Resources tab has these secondary tabs:

  • Default: This is where you define alias names for web services. You can also specify a default URL for each alias (optional).
  • Sandbox: This is where you can define specific URLs for the aliases, for the Sandbox environment.

If you have multiple environments (for example, QA, Production), a tab is available for each environment.

To add an alias and configure the default base URL for a web service:

  1. In the Mix dashboard, select the project.
  2. Click the External Resources tab.
  3. Click the Default tab.
  4. Under Data Hosts, for each web service:
    1. Enter the desired alias name.
      For example, for the coffee app, you might enter COFFEE_APP.
    2. (Optional) Enter a base URL for this alias.
      For example, for the coffee app, this might be https://coffee.app.com:443
  5. Click Add Alias.
  6. (Optional) To specify a different base URL for the Sandbox or any other environment:
    1. Click the tab for the environment.
      For example, click the Sandbox tab.
    2. Click the Edit icon for the alias.
    3. Enter the desired base URL.

Order of precedence for URL values

You can specify a URL for an alias in the following locations:

  • In the Default tab, under Data Hosts, which sets a value by default.
  • In a specific environment tab (such as Sandbox), which sets a value for this environment. This value takes precedence over the default value set on the Default tab.
  • When you create an application configuration, which sets a value for the environment where you deploy this application configuration. This value takes precedence over all other values.

Configure data to exchange in data access node

To configure the data to exchange for a server-side integration, create a data access node in Mix.dialog and specify the following fields:

DataAccess fields
Field Description
Latency message Message played when a data access request is pending. See Handle latency messages in client app.
Send Data Data that will be sent to the client application, for example, coffee size and type. This can be a variable or an entity.
Get Data Data that will be returned by the client application, for example, coffee price. This is a variable.
Success Node to go to if the external system returns a success code; that is, a returnCode of “0”.
Failure Node to go to if the external system returns a failure code; that is, a returnCode that is not “0”.
Integration Disable the Enable client-side fetching option to indicate that the dialog service interacts directly with a backend system to exchange data. See Specifying server- vs. client-side integration.
Copy connection settings from Lets you select default connection settings. See Configure default connection settings.
Data Host Alias Alias configured in the Mix dashboard to define the web service. For example, COFFEE_APP might refer to https://coffee.app.com:443. See Configure base URL of web service in the dashboard.
URL Extension Specifies the endpoint used to access the data; for example, /coffee/price and /coffee/calories. This is defined by the backend (maximum 2000 characters).
Fetch Timeout Number of milliseconds allowed for fetching the data before timing out.
Connection Timeout Connection timeout in milliseconds.
Method HTTP method to use; supported values are POST and GET. This is defined by the web service.
Headers List of key-value pairs providing the headers to send to the web service. To specify a dynamic value, click the arrow to the right of the value field and select the variable. Alternatively, you can enter a static value (maximum 2048 characters) directly in the field.
Note: Do not specify reserved or special header names such as Accept, Accept-*, and Content-Type. While Mix does not prevent you from using them, they may generate errors. Custom headers and headers used to identify the client with the server, for authorization, to provide generic information, and so on, can be sent.

For example:

Data access node for server-side integration

For a detailed description of the data access node, see Set up a data access node.

Configure default connection settings

You can configure default connection settings and use them in the data access node. This is useful if you plan to reuse them in multiple data access nodes.

To configure default connection settings:

  1. On the Mix.dialog toolbar, click Data.
  2. Click the + icon next to Data connections.
  3. Type a unique name for the data connection and press Enter.
  4. Enter the information described in the following table.
Data Connection fields
Field Description
Data Preset Name Enter a name that defines this data connection.
Data Host Alias Alias configured in the Mix dashboard to define the web service. For example, COFFEE_APP might refer to https://coffee.app.com:443. See Configure base URL of web service in the dashboard.
URL Extension Specifies the endpoint used to access the data; for example, /coffee/price and /coffee/calories. This is defined by the web service (maximum 2000 characters).
Fetch Timeout Number of milliseconds allowed for fetching the data before timing out.
Connection Timeout Connection timeout in milliseconds.
Method HTTP method to use; supported values are POST and GET. This is defined by the backend.
Headers List of key-value pairs providing the headers to send to the web service. To specify a dynamic value, click the arrow to the right of the value field and select the variable. Alternatively, you can enter a static value (maximum 2048 characters) directly in the field.
Note: Do not specify reserved or special header names such as Accept, Accept-*, and Content-Type. While Mix does not prevent you from using them, they may generate errors. Custom headers and headers used to identify the client with the server, for authorization, to provide generic information, and so on, can be sent.

For example:

Example Data connections tab

Build and deploy dialog application

To test your application in the runtime environment, you need to build a new version and deploy it in an environment.

When you deploy the application, you can configure a new URL for the alias if necessary, as shown in the following diagram. This URL will take precedence over all other values previously defined.