As described in the Actions concept section, Bavard chatbots play one or more actions at each turn of a conversation. Webhook actions essentially allow developers to implement completely custom actions for their chatbots, including actions that integrate with other systems. Typical examples of webhook actions are those for checking the weather, getting a stock quote, or looking up data in a private database.
A webhook action is defined simply by a URL endpoint and a secret string value. When your bot plays the action, it will send an HTTP POST request to the URL you provided along with a header containing the secret. The request body includes the entire conversation history and state. The endpoint server is expected to return one or more valid response actions. The webhook action itself is silent, meaning it is not shown to the end user, however the responses returned from the webhook endpoint are displayed.
You can find a demo code for implementing a webhook action server in Node.js here.
© 2021 Bavard AI, Inc. All rights reserved.