back to tutorials

How to use Data Extraction integration

Learn how to effectively use ChatBotKit's Data Extraction integration to capture and send data from conversations to third-party endpoints. Follow our step-by-step guide for setup, configuration, and testing.

This tutorial will guide you through using ChatBotKit's Data Extraction integration to extract data from conversations and send it to a third-party HTTP endpoint, such as a webhook on RequestBin or Zapier.

Step 1: Setting Up Data Extraction Integration

  1. Log in to ChatBotKit: Access your ChatBotKit account and navigate to the "Integrations" tab.
  2. Enable Data Extraction: Expand "Even More Integrations" and select "Extract Data".
  3. Configure Integration:
    • Specify a name and an optional description for the integration.
    • Provide a custom JSON schema to define the data your chatbot will extract.

Example JSON Schema

Let's assume you're running an e-commerce platform. Here’s an example schema to extract the customer's name, email, interested product, and specific question or issue.

{ "name": { "type": "string", "description": "The customer's full name" }, "email": { "type": "string", "description": "The customer's email address" }, "product": { "type": "string", "description": "The product the customer is inquiring about" }, "question": { "type": "string", "description": "The customer's specific question or issue about the product" } }

This schema will direct the chatbot to extract relevant information, which will be stored in the conversation metadata.

Step 2: Configuring Webhook for Data Transmission

  1. RequestBin Setup:
    • Go to RequestBin.
    • Create a new RequestBin endpoint URL.
    • Make note of the endpoint URL; you will need it to configure your data transmission.
  2. Configure Request Settings in ChatBotKit:
    • Navigate to the Advanced Option of the Extraction Integration.
    • Specify the URL using your RequestBin endpoint.
    • Optionally, set up custom headers if needed.

Here’s an example of how your request configuration might look:

https://enuuqklc3478c.x.pipedream.net

Step 3: Testing and Validating the Setup

  1. Create a Test Conversation:
    • Design a conversation flow that collects the necessary data as defined in your JSON schema.
    • Start a conversation with your chatbot and provide the inputs required by the schema.
    • Keep in mind that the data will be collected when the conversation becomes idle, which occurs exactly 30 minutes after the last message.
  2. Check RequestBin:
    • Go to your created RequestBin link.
    • Validate that the data from the conversation is correctly sent and displayed in RequestBin.

Step 4: Setting Up a Zapier Webhook (Optional)

  1. Create a Webhook in Zapier:
    • Log in to your Zapier account and create a new Zap.
    • Select the "Webhooks by Zapier" trigger event and generate a custom webhook URL.
  2. Configure Request Settings in ChatBotKit:
    • Use the Zapier webhook URL in the Data Extraction integration settings.
    • Follow the same steps as above to configure headers and request type if necessary.

Common Caveats

  • Accurate Schema Design: Improper JSON schema design can lead to incorrect data extraction. Test your schema thoroughly.

By following these steps, you'll effectively utilize ChatBotKit's Data Extraction integration to capture crucial information from conversations and transmit it to your chosen third-party endpoint for further processing.