LogoLogo
  • Introduction to the Ebbot Platform
  • Ebbot Platform
  • Bot basics
    • Scenarios
    • Entities
    • Triggers
    • Training center
  • Scenarios
    • Cards and syntax
      • File Input
      • Text card
      • Input
      • Buttons
      • Image
      • File
      • Carousel
      • Location
      • List
      • Contact Agent
      • Rating request
      • Custom component
      • CoBrowsing
    • Transition
    • Card properties
  • AI Insights
    • Setup and Configuration
    • Using the Insights Dashboard
  • EbbotGPT
    • Knowledge
      • Data source transformer
      • Source types
        • File
        • Website scrape
        • Docx file
        • TOPdesk API
        • Sitevision API
        • SharePoint API
          • Create app with Sites.FullControl.All permission in Azure
          • Ebbot SharePoint Postman Guide
        • Confluence API
    • Configurations
    • GPT Evaluation
    • Embedder models
    • EGPT models
  • Custom vocabulary
  • Tutorials
    • Create your first scenario
      • Select a trigger
      • Add bot responses
  • Data Object
  • Release notes
  • For developers
    • Ebbot SDK
    • Safe Exchange API / Vault
    • Subdomain manager
  • EbbotGPT API
  • Chatbot & Live chat
    • Install chat widget
    • Chats API
    • Chat widget API
    • Datasource API
    • Sales tracking for live chat
    • Webhook
      • Incoming webhooks
      • Outgoing webhooks
    • SMS API
      • Authentication
      • Send SMS
      • Errors
      • Encoding
    • Python components
    • Intent detection (NLP)
  • Product guides
    • Product data feeds
    • Install guide
    • Product guide events
      • Product guide user events
      • Received events
      • Send events
    • API & webhooks
    • GA4 integration
    • Klaviyo integration
  • Messenger marketing
    • Install popup
    • API & webhooks
  • For chat agents
    • Ebbot Chat
      • Settings modal
      • Queue
      • Topbar Stats
      • Menu
        • Power-Ups!
        • Quick Replies
  • INTEGRATIONS
    • Ebbot Live Chat in Zendesk
      • Setup guide
    • Active Directory - SAML
    • Configure SAML in Azure
Powered by GitBook
On this page
  • Overview
  • Structure
  • Parameters Object
  • DB Object
  • Conversation Object
  • Customer Object
  • Usage
  • File Upload Card Example

Was this helpful?

Data Object

The data object is a powerful tool for managing and accessing information throughout a conversation. It allows you to store and retrieve data as well as access conversation and customer information, providing flexibility and customization for your chatbot. This documentation will guide you through the structure of the data object and its various components.

Overview

The data object consists of the following key components:

  • id: Unique identifier for the current state in the conversation.

  • name: Name of the current state.

  • parameters: An object to pass data into custom components, not persisted across states.

  • db: An object to store and retrieve data throughout the conversation.

  • conversation: An object containing information about the conversation.

  • customer_info: An object containing information about the customer.

  • chatId: Unique identifier for the chat.

Structure

The data object has the following structure:

{
    "id": "example_id",
    "name": "state_example",
    "parameters": {},
    "db": {},
    "conversation": {
        "user_last_input": "Hello there 😀",
        "browser": "chrome",
        "os": "Mac OS",
        "platform": "web",
        "time_before_start": 0
    },
    "customer_info": {
        "id": "example_customer_id",
        "image": null,
        "info": {
            "invoice_id": "3453342",
            "premium_customer": "true"
        },
        "first_name": "Inclined", 
        "last_name": "Kangaroo"
    },
    "chatId": "example_chat_id"
}

Parameters Object

The parameters object is empty by default but can be used to pass data into custom components. The data stored in the parameters object will not be persisted during the conversation and is only valid for the triggered component.

DB Object

The db object allows you to store and retrieve data during the conversation. For example, you can store user inputs, variable button presses, and information about uploaded files.

Conversation Object

The conversation object contains information about the ongoing conversation, such as the user's last input, the browser used, the operating system, and the platform.

Customer Object

The customer_info object contains information about the customer, such as their unique ID, first and last name, and any additional information you'd like to store.

Usage

You can access and manipulate the data object throughout the conversation to provide a personalized and dynamic user experience. Store data in the db object, pass temporary data through the parameters object, and access conversation and customer information to customize the chatbot's responses.

File Upload Card Example

When a user uploads a file using a File Upload Card, the information about the uploaded file is stored in the db object. Here is an example of how the db object would look like after a file has been uploaded:

"db": {
    "customer_uploaded_file": {
        "messageId": "example_message_id",
        "files": [{
            "filename": "logo (1).png",
            "size": 3385,
            "mimetype": "image/png",
            "label": "logo (1).png",
            "key": "example_key",
            "url": "https://example.storage.googleapis.com/example_path/logo_(1).png"
        }],
        "type": "file_list"
    }
}

In this example, a user has uploaded a file named "logo (1).png". The file information is stored under the customer_uploaded_file key in the db object. You can access this information throughout the conversation to perform actions such as displaying the file, sending it to another API, or storing it in a database.

To access the uploaded file's URL, you can use the following syntax:

file_url = data['db']['customer_uploaded_file']['files'][0]['url']
PreviousAdd bot responsesNextRelease notes

Last updated 2 years ago

Was this helpful?

This will retrieve the URL of the uploaded file, which can be used for further processing or displaying to the user. For more information and examples on working with Multi File Input, please refer to our page.

GitBook