Get KnowledgeBase answers directly in Chatbot chat

2 min. readlast update: 10.17.2023

If you want to get KnowledgeBase article suggestions during a ChatBot session, you can use our integration to send cards in response to a customer query.

In this article, we'll go through creating a webhook and adding it to the chatbot story.

Preparations

For integration to work, you need KnowledgeBase license number. You can find it in My Profile in the left navigation. 

undefined

When you click on the License ID element, your license number will be copied to the clipboard.

Creating the webhook integration in ChatBot

  • Login to Chatbot account and go to integrations section. Select Webhooks
undefined

  • Then click Add new webhook:
undefined

  • During webhook creation, put following details in the form:

undefined

  • Webhook name: Knowledge Base
  • Webhook url: https://api.knowledgebase.ai/api/chatbot/answers
  • Verification token: knowledgebase-verification
  • Headers:
    • X-Forwarded-License: your license number from step #1.

Then hit Save and go to your ChatBot Story

Adding KnowledgeBase integration to your story

Here is a simple story that utilizes the webhook integration: 

undefined

undefined

In the webhook story block, you should select Knowledge Base. Then any user input defined in user says will be forwarded to KnowledgeBase and if any articles were found that match user query, it'll be returned as cards. 

Customizing response cards

You cannot change the article title or contents that are displayed in the integration, but you can pick the image that is displayed along with the card. In order to set the image, you need to go to Help Center section of KnowledgeBase app and change Preview image in the Appearance section.

Fallback if no answers found

You need to define your own behaviour in case that no answers were found in the KnowledgeBase. You should add a bot response and a filter to make sure that only empty searches would trigger that:

undefined

Click Add filter and then select Add filter for the custom attribute. It should be configured as follows:

undefined

You can also add your own custom logic based on articles that were found. Remember that integration will only return the top 3 articles, even though the search could yield more results.

Was this article helpful?