OpenDialog Docs
opendialog.aiStart BuildingTalk to an expert
  • GETTING STARTED
    • Introduction
    • Getting ready
    • Billing and plans
    • Quick Start AI Agents
      • Quick Start AI Agent
      • The "Start from Scratch" AI Agent
        • Chat Management Conversation
        • Welcome Conversation
        • Topic Conversation
        • Global No Match Conversation
        • Supporting LLM Actions
        • Semantic Classifier: Query Classifier
      • A Process Handling AI Agent
  • STEP BY STEP GUIDES
    • AI Agent Creation Overview
    • Add a new topic of discussion
    • Use knowledge sources via RAG
    • Adding a structured conversation
    • Add a 3rd party integration
    • Test and tweak your AI Agent
    • Publish your AI Agent
  • CORE CONCEPTS
    • OpenDialog Approach
      • Designing Conversational AI Agents
    • OpenDialog Platform
      • Scenarios
        • Conversations
        • Scenes
        • Turns and intents
      • Language Services
      • OpenDialog Account Management
        • Creating and managing users
        • Deleting OpenDialog account
        • Account Security
    • OpenDialog Conversation Engine
    • Contexts and attributes
      • Contexts
      • Attributes
      • Attribute Management
      • Conditions and operators
      • Composite Attributes
  • CREATE AI APPLICATIONS
    • Designing your application
      • Conversation Design
        • Conversational Patterns
          • Introduction to conversational patterns
          • Building robust assistants
            • Contextual help
            • Restart
            • End chat
            • Contextual and Global No Match
            • Contextual FAQ
          • Openings
            • Anatomy of an opening
            • Transactional openings
            • Additional information
          • Authentication
            • Components
            • Example dialog
            • Using in OpenDialog
          • Information collection
            • Components
            • Example dialog
            • Using in OpenDialog
            • Additional information
          • Recommendations
            • Components
            • Example dialog
            • Additional information
          • Extended telling
            • Components
            • Example dialog
            • Additional information
          • Repair
            • Types of repair
            • User request not understood
            • Example dialog
            • Additional information
          • Transfer
            • Components
            • Example dialog
            • Additional information
          • Closing
            • Components
            • Example dialog
            • Using in OpenDialog
            • Additional information
        • Best practices
          • Use Case
          • Subject Matter Expertise
          • Business Goals
          • User needs
            • Primary research
            • Secondary research
            • Outcome: user profile
          • Assistant personality
          • Sample dialogs
          • Conversation structure
          • API Integration Capabilities
          • NLU modeling
          • Testing strategy
          • The team
            • What does a conversation designer do
          • Select resources
      • Message Design
        • Message editor
        • Constructing Messages
        • Message Conditions
        • Messages best practices
        • Subsequent Messages - Virtual Intents
        • Using Attributes in Messages
        • Using Markdown in messages
        • Message Types
          • Text Message
          • Image Message
          • Button Message
          • Date Picker Message
          • Audio Message
          • Form Message
          • Full Page Message
          • Conversation Handover message
          • Autocomplete Message
          • Address Autocomplete Message
          • List Message
          • Rich Message
          • Location Message
          • E-Sign Message
          • File Upload Message
          • Meta Messages
            • Progress Bar Message
          • Attribute Message
      • Webchat Interface design
        • Webchat Interface Settings
        • Webchat Controls
      • Accessibility
      • Inclusive design
    • Leveraging Generative AI
      • Language Services
        • Semantic Intent Classifier
          • OpenAI
          • Azure
          • Google Gemini
          • Output attributes
        • Retrieval Augmented Generation
        • Example-based intent classification [Deprecated]
      • Interpreters
        • Available interpreters
          • OpenDialog interpreter
          • Amazon Lex interpreter
          • Google Dialogflow
            • Google Dialogflow interpreter
            • Google Dialogflow Knowledge Base
          • OpenAI interpreter
        • Using a language service interpreter
        • Interpreter Orchestration
        • Troubleshooting interpreters
      • LLM Actions
        • OpenAI
        • Azure OpenAI
        • Output attributes
        • Using conversation history (memory) in LLM actions
        • LLM Action Analytics
    • 3rd party Integrations in your application
      • Webhook actions
      • Actions from library
        • Freshdesk Action
        • Send to Email Action
        • Set Attributes Action
      • Conversation Hand-off
        • Chatwoot
    • Previewing your application
    • Launching your application
    • Monitoring your application
    • Debugging your application
    • Translating your application
    • FAQ
    • Troubleshooting and Common Problems
  • Developing With OpenDialog
    • Integrating with OpenDialog
    • Actions
      • Webhook actions
      • LLM actions
    • WebChat
      • Chat API
      • WebChat authentication
      • User Tracking
      • Load Webchat within page Element
      • How to enable JavaScript in your browser
      • SDK
        • Methods
        • Events
        • Custom Components
    • External APIs
  • Release Notes
    • Version 3 Upgrade Guide
    • Release Notes
Powered by GitBook
On this page
  • Headers
  • Mocking a webhook
  • Dealing with failed actions
  1. CREATE AI APPLICATIONS
  2. 3rd party Integrations in your application

Webhook actions

Previous3rd party Integrations in your applicationNextActions from library

Last updated 6 months ago

The webhook action allows you to send and receive data from an external service via a HTTP POST request to a provided webhook URL.

For some more details around the data structures you can use please see the section.

Once you have a service that provides the desired functionality, you'll want to create a new webhook by following the action creation steps and set the action's URL to be the URL of your service.

Headers

You can add headers in the action configuration page that will be send along with the HTTP POST request.

This could be used to send authorization tokens and other custom headers as required by the webhook.

Mocking a webhook

This will provide you with a webhook URL, the ability to see the inputs sent by OpenDialog, and the ability to set a static response to be returned to OpenDialog. This can be useful to understand how the input and output attributes of an action will fit in with your conversation flows.

This example mocks a webhook action that takes input of a first & last name, and outputs a concatenated full name.

First, let's create a test action in OpenDialog and set the webhook endpoint to point to our mocked webhook endpoint on Postman.

The url we are using is https://af7df53c-9871-40de-a454-31d5cf2d6237.mock.pstmn.io /your-webhook-endpoint

Now, we can set up the input attributes. This is the information we will be collecting from our scenario and sending to our webhook endpoint. In this case it will be the user's first and last name.

In the Headers section you can setup and authentication token required and you can also send headers that include conversation attributes such as the user's ID.

Ok, so we've setup a first_name and last_name as input attributes and indicated that we expect a full_name as an output attribute (i.e. the result of our action).

The webhook action is permissive in that it will accept input attributes that were not explicitly defined here and it will also show output attributes that were not explicitly defined. Output attributes will be stored by default in the user context. The main reason to define attributes is to provide clarity for what the expectations are and to be able to manipulate via the UI where attributes are stored (i.e. in which context).

Now, we can test our action by click on the Test Action Using JSON button.

We will get the preset response from the mock Postman server.

Now, we can activate our action to make it available in a scenario.

Finally, we can add the action to a specific intent so that it is run whenever that intent is selected.

In this case, I've added the action to the WelcomeResponse intent, so it will be executed whenever that intent is executed. You might notice in the screenshot that there is another action defined (Customise welcome message). You can run multiple actions on an intent and they will be executed in order.

Before testing it out let's setup the WelcomeResponse message to use the results of the Webhook test action. We will edit the message associated with this intent and use the user's full name in the message.

  1. Click on Edit Messages.

  1. Click on the WelcomeResponse edit button

  1. We are going to add a text block to our message that greets the user.

  1. Now if we visit the preview section we will see that we are extracting the information from the action and using it to greet the user.

Well done! You've created your first action using the Webhook action in OpenDialog.

Dealing with failed actions

Actions can fail so we need to be able to check for that from our conversation design and deal with it appropriately.

Every action automatically generates a boolean attribute (true/false) based on the action name. For the example above that would be webhook_test_action_success

We can see the value of this attribute in our user context.

We can check for the value of this attribute in our conditions before we use the output of the attribute.

For example, we could have two messages one used when webhook_test_action_success is true and one for false.

If you would like to test OpenDialog's webhook action functionality ahead of developing a webhook, you can generate a mocked webhook using a service such as or Postman.

The following steps use an example we provide through Postman - available .

webhook.site
here
Integrating with OpenDialog
A webhook action that sends/receives data from "https://api.example.com/opendialog"
A webhook action
Testing a webhook action
Activating an action.
Adding an action to an intent.