Product Guide
APIsProductUpdatesPricingFAQs
  • Introduction to REVE Chat
  • Integrations
    • Website
    • Social Media Channels
      • WhatsApp
      • Instagram Messaging and Comment
      • Facebook Messenger and Comment
      • Viber
      • Telegram
    • Direct Chat Page
    • Mobile SDK
      • Native Android SDK
      • Native iOS SDK
      • Flutter Android SDK
      • Flutter iOS SDK
      • React Native iOS SDK
      • React Native Android SDK
    • Email Integration
      • Forward emails to your REVE Chat tickets
      • Integrate Your Business Email
        • Connecting Gmail with POP/IMAP Settings
    • All Integrations
      • CRM Integrations
        • Pipedrive
        • Salesforce
        • HubSpot
        • MS Dynamics
        • Amo CRM
        • Agile CRM
        • Vtiger
        • Capsule
        • Infusionsoft (by Keap)
      • CMS Integration
        • WordPress
        • DotNet Nuke
        • Blogger
        • Joomla
        • Drupal
        • ModX
      • E-commerce
        • Shopify
        • Bigcommerce
        • WooCommerce
        • Prestashop
        • 3dCart
        • Pinnacle Cart
        • Corecommerce
        • BigCartel
        • ECWID
        • LemonStand
        • Ebay
        • Volusion
        • Americommerce
        • osCommerce
        • Magento
          • By Manual Code Injection
        • Zencart
        • XCart
        • OpenCart (V4.0.x)
          • OpenCart (Old Version Integration)
        • CSCart
        • Abantecart
      • Website Builder
        • Wix
      • Hosting Platform
        • Plesk
        • WHMCS
      • Analytics
        • Google Tag Manager
        • Google Analytics
    • Google Integration
      • YouTube Integration
      • Google Play Store
      • Google Business Account
  • Appstore
  • Inbox
    • Breaking Down of Single Inbox
    • Folders of Single Inbox
    • How Conversation Works!
    • Chat Monitoring for All Ongoing Agents' Chat
    • Chat History for All Closed Conversations
    • Proactive Chat Management
    • Voice & Video Call
    • Co-Browsing
    • How to use Shortcuts
    • Inbox Appearance
  • Contacts
    • Manage Your Contacts
    • Segments
  • WhatsApp Campaign
    • What is WhatsApp Campaign?
      • Broadcast: Send Campaigns
      • Templates: Create Campaign
  • Tickets
    • Set up your Ticketing email
    • Create Ticket
      • Create a ticket manually
      • Ticket from Chat History
      • Automated & Bulk Ticket Creation
    • Knowing your Ticketing tables
      • Custom Ticketing Tables
    • Managing a Ticket
  • Chatbot
    • Bot Builder
      • Response Elements
        • Text Action
        • Quick Reply Action
        • Carousel Action
        • Button Action
        • Send Email
      • Data Collection
        • Ask Name
        • Ask Phone
        • Ask Email
        • Ask Question
        • Ask OTP
        • Ask File
        • Ask Date
        • Ask Time
        • Forms
        • Ask Number
      • Media
        • Image Action
        • Audio Action
        • Video Action
        • File Action
      • Workflow Action
        • Condition Action
        • Chat Transfer Action
        • Close Chat
        • Appointment Action
        • Attribute Action
        • Business Hour
        • System Attributes
      • Advanced Action
        • Salesforce Bot Action Manual
        • API Connector
        • Goal
        • Dynamic Data
    • Brain AI
      • ChatGPT Integration
    • Settings
      • Bot Profile
      • General Settings
      • Webhook
    • Training
      • Intent Sample
      • Sentiment
      • Synonyms
      • FAQ
      • Untrained
      • Trained
      • Bulk Training
    • Multilingual Bot
  • Reports
    • Summary
    • Chat Satisfaction
    • Chatbot Report
      • Bot Engagement
      • Flow Engagement
      • Goal Analysis
    • Agent Analytics
      • Agent Activity
      • Agent Performance
      • Metrics
      • SLA Breach Analysis
    • Ticket Analytics
      • Dashboard
      • Metrics
    • Visitor Analytics
    • Enterprise Report
      • Daily Agent Performance
      • Hourly Agent Performance
      • Daily Group Performance
      • Traffic Analysis Report
      • First Response Time
  • User Profile
    • Billing
    • Help & Feedback
  • Settings
    • General Settings
      • Auto Triggers
      • Forms
        • Pre Chat Form
        • Post Chat Form
        • Custom Forms
          • Advanced Forms
        • Ticket Forms
      • Canned Responses
      • Custom Attributes
      • Call Recording
      • Tags
      • Appointment
      • Departments
      • Chat Transcript Forwarding
      • Ban Visitor
      • Trusted IP & Domain
      • Business Hour
    • Chat Widgets
      • Appearance
      • Custom Message
      • Widget Features
      • Forms
      • Code Snippet & Quick Share
    • Ticketing
      • Email Templates
      • Status Management
    • Agent Management
      • Agents
      • Departments
      • Role Management
    • API Settings
      • Json Parse Format
    • Scripts
    • SLA Policy
    • Routing Policy in REVE Chat
      • Chat Routing
      • Advanced Routing
    • Other Settings
Powered by GitBook
On this page
  • 1. Configure the REVE Chat Webhook API
  • 2. How to call webhook inside chatbot

Was this helpful?

  1. Chatbot
  2. Settings

Webhook

PreviousGeneral SettingsNextTraining

Last updated 4 months ago

Was this helpful?

1. Configure the REVE Chat Webhook API

Your website team needs to call the REVE Chat Webhook API to transmit user information to the chatbot. It is recommended that your team needs call the API from server side. Follow the below steps to configure Webhook.

a. Accessing the Webhook for a Bot

  • Navigate to the Bot: Login to your REVE Chat Dashboard. Click on Chatbot from the vertical nav bar, then select your bot that your team is working on.

  • Access Webhook Settings: Once you land into your chatbot, in the top navigation bar click on Settings > select Webhook in the left navigation menu of the chatbot settings page.

b. Create your Webhook and Endpoint

  • Find or Create a Webhook: You need to generate a webhook link for your chatbot. Please note that each bot will have separate webhook link.

  • Create an Endpoint: You can also create specific endpoints to send data to the webhook. These endpoints are appended to the main webhook link.

  • Save your response: You can create your endpoint from here and define which attribute to save the webhook response. Also, you can define in the chatbot which flow will be triggered if you send data to this webhook. For e.g. customer logged in the website and you want to send data in the chatbot.

c. Sending Data to the Webhook

To send data to the webhook, include the following in the API header:

  • Authorization: Bearer <token from webhook configuration>

    • Each bot has a unique authorization token, which can be refreshed as needed. Refreshing invalidates any previous token, so avoid updating the token unless necessary.

    • The authorization token can be found on the webhook settings page.

Note: Authorization tokens can be refreshed at any time. However, doing so invalidates the previous token. Only refresh when necessary to maintain security and access continuity.

Example Curl:

curl -X POST "https://chatbot-uat.stc.com.kw/chat-websocket/api/webhook/v1/chatbot/bcad140a-4bd3-4976-9913-5c00e6987ece/login" \
-H "Authorization: Bearer <token from webhook configuration>" \
-H "Content-Type: application/json" \
-d '{
  "sessionId": "<sessionId>",
  "botId": "<botId>",
  "data": {
    // pass your data here
  }
}'

2. How to call webhook inside chatbot

a. Create an script to Call Brower Script

To send the data to the website team needs to send user data in the webhook along with the sessionId and botId parameter. The ongoing session sessionId and botId can be found with below approach.

  • Your team should create a custom JavaScript function such as- `chatbot.someFunctionName(param)`.

  • You can get the sessionId and botId in the param object and your team can use that param object to access the sessionId and botId like param.session_id and param.chatbot_id in their function. Here's an example script:

return new Promise(resolve => {
    let jsonObject = {
        chatbot_id: data.chatbot_id,
        session_id: data.session_id
    }

    let obj = {
        type: "run_script",
        script: `ChatbotFunction(${JSON.stringify(jsonObject)});`
    }
    resolve(obj);
});

b. Create an script to Save your response

You need to use another script to process the data you're sending in the webhook. For e.g. you are sending user login information Name, Phone etc. You can process this data with Script.

return new Promise(resolve => {
    const loginDetails = JSON.parse(data.employee_login_details);

    let returnObj = {
        type: "set_variables",
        variables: {
            login_status: loginDetails.isLoggedIn
        }
    };

    if (loginDetails.name) {
        returnObj.variables.name = loginDetails.name;
    }

    if (loginDetails.isLoggedIn && loginDetails.phone) {
        returnObj.variables.phone = loginDetails.phone;
    } else {
        returnObj.variables.phone = "";
    }

    resolve(returnObj);
});

c. Configure your chatbot

  • First you need to check from chatbot when to call the browser script. It will trigger the script and fetch information in the beginning. If it is not needed in the beginning, you can define when it can be called. This script will allow the REVE Chat widget to call a browser script to get data.

  • Then, in the webhook settings, you need to define which node it will trigger if an endpoint receives data. From there, you can process the user response and take user to separate flow with condition action.

This will allow you to further save your response and take user to different flow with Condition action.

Any questions? Please email us at or .

Here's how to use script.
Learn how to use condition action.
issue.support@revechat.com
scan to chat with us
Create your webhook URL
Create an API Endpoint
Create an Endpoint and Redirect the