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
    • Persona
    • 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

Was this helpful?

  1. For developers

Safe Exchange API / Vault

How to Inject Sensitive Data into an Ongoing Chat Using the Safe Exchange API

The Safe Exchange API is designed to securely inject sensitive data into an ongoing chat session. Here’s a step-by-step guide on how to set it up and use it effectively:

Fetch the Chat ID

This can be done when the information should be injected, for example when a user successfully logs in to the site. The chatId is required for the Safe Exchange API to know where the information should be injected.

  • When an Ebbot chat widget is loaded on a web page, a unique chat ID is generated and saved in the client’s local storage.

  • Retrieve this chat ID from local storage. The key follows the format: <bot_id>_ebbot_chat_session_id.

  • You can find the botID in Ebbot App under Chat Widget -> Settings.

Performing the API Call

  • Use the retrieved chat ID to make an API call to inject data.

API Call Details

  • Method & Endpoint: PUT https://<ebbot-url>/api/chats/<chatId>/vault

Note that the ebbot URL can differ depending on environment. Available urls are: v2.ebbot.app, ca.ebbot.app, ebbot.eu

  • Authorization Headers: Include the API Key in the x-api-key header. This key can be generated in the Ebbot platform by navigating to: Settings -> Integrations -> API Keys

    Example format:

    {
      "x-api-key": "<publicKey>.<secretKey>"
    }
  • Payload: The data to be injected should be in JSON format.

    Example:

    {
      "loggedIn": true,
      "customerInformation": {
        "first_name": "John",
        "last_name": "Smith",
        "customer_number": 1337
      }
    }
  • cURL Example:

    curl --location --request PUT 'https://ebbot.eu/api/chats/<chatId>/vault' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: ••••••' \
    --data '{
      "loggedIn": true,
      "customerInformation": {
        "first_name": "John",
        "last_name": "Smith",
        "customer_number": 1337
      }
    }'

Listen to Chat Events

Recommended Events:

  • onReset

  • onCreate

  • onStartConversation

Important Note

  • Although the ChatWidgetAPI’s setUserAttribute function can also inject data into an ongoing chat, it's not recommended when dealing with sensitive information. This is due to security concerns of potential misuse through client browsers.

Data Storage in Vault

  • Once injected, the data is stored in the vault section of the chat’s data object as key/value pairs.

  • You can access or expand these variables within the bot's responses using the format: {{ vault.key_name }}.

PreviousRelease notesNextSubdomain manager

Last updated 5 months ago

Was this helpful?

Your web page can listen to specific events in the chat widget using the . This can help determine the appropriate time to inject data.

For detailed information, refer to the

ChatWidgetAPI
Chat Widget API Reference.