XBot
  • Overview
    • Introduction
    • How xBot Works
    • Target Audience
    • Key Benefits of xBot
    • Core Concepts of xBot
  • Quick Start
    • Quick Setup
    • Getting Started
      • Zalo Channel
      • Azure Bot Framework
      • FaceBook Channel
      • Team Channel
      • Webchat Channel
      • Email Channel
    • Basic Configuration
    • First AI Flow Setup
    • Initial Testing and Go Live
  • Features
    • Using xBot to Handle End-User Queries
    • Communication Channels
      • Zalo OA
      • Facebook
      • Teams
      • WebChat
      • Email
    • Understanding the Message Handling Flow
    • Understanding AI Bots in xBot
    • Configuring Dispatch Rules in xBot
    • User Functions and Permissions
      • Custom Roles and Permissions
      • Auditing and Monitoring User Activities
    • Cross-Platform Message Type Compatibility
    • AI Flow
      • Core Concepts
      • AI Services
        • Knowledge Base Agent
        • AI Agent
        • AI Proxy Agent
      • Knowledge Base
      • Functions
      • Evaluation Metrics
        • Essential Information
        • Basic Metrics
        • Extra Metrics
  • Integration Guide
    • Integrates with multiple channels
      • API reference
        • Webhook
          • ZaloPushToXBot
          • AzbotPushToXBot
        • Webchat
          • InitForClient
  • References
    • Industry-Specific Use Cases
      • Media and Entertainment
      • Wholesale
      • Transportation and Logistics
      • Manufacturing
      • Energy and Utilities
      • Real Estate
      • Agriculture
      • Travel and Hospitality
      • Healthcare and Wellness
      • Retail and E-Commerce
      • Public Administration
      • Legal
      • Training
      • Education
      • xBot Use Case: Insurance
      • Securities -Use Case
      • Banking - Use Case
      • xBot Use Case: Finance
Powered by GitBook
On this page
  1. Integration Guide
  2. Integrates with multiple channels
  3. API reference

Webchat

WebChat

1. Init And Refresh Token For Client

Request URI

Name
Description

URI

Content-Type

application/json

Method

POST

Request Headers

Name
Required
Description
Remarks

x-api-key

Y

Api Key AWS

xp-api-key

Y

XBot will generate an xp-api-key and provide it to you. This key is used for authentication when XBot interacts with your system.

Request param

Key

Description

id

User's unique identifier

name

User's full name

email

User's email address

phone

User's phone number

address

User's physical address

avatarUrl

URL of the user's avatar image

extData

Additional data related to the user, which can be extended with more fields as needed

Request Sample

{
    "userInfo": {
        "id": "nguyenvana",
        "name": "Nguyen Van A",
        "email": "nguyenvana@gmai.com",
        "phone": "84988883434",
        "address": "z06, Tân Thuận Đông, Quận 7, Tp HCM",
        "avatarUrl": "https://cdn.britannica.com/mendel/eb-logo/MendelNewThistleLogo.png",
        "extData": {}
    }
}

Response

Key

Description

status

The status of the response (e.g., 0 for success)

data

Contains detailed information about the response

conversationId

Unique identifier for the conversation

userId

Unique identifier for the user

token

Authentication token for the session

expiresIn

Token expiration time in seconds

Data Populated in the Table Format:

Response Sample

{
    "status": 0,
    "data": {
        "conversationId": "3kgMqNT6Etr3EwIoX2CzzK-as",
        "userId": "XCHATBOT.A4B.WEBCHAT.nguyenvana",
        "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkxXMTJxbHBaYl9Xd09FUklGclhTY0VqOEJDUSIsIng1dCI6IkxXMTJxbHBaYl9Xd09FUklGclhTY0VqOEJDUSIsInR5cCI6IkpXVCJ9.eyJib3QiOiJpc2lnbl9ib3RfdWF0Iiwic2l0ZSI6IjF2bXlNQndTdll3IiwiY29udiI6IjNrZ01xTlQ2RXRyM0V3SW9YMkN6ekstYXMiLCJuYmYiOjE3MjE5NjAxOTIsImV4cCI6MTcyMTk2Mzc5MiwiaXNzIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIiwiYXVkIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIn0.KojNJ-c7dhYK_KN_t8ZOTBinYkVwmtbqFFsKveJ1AThymdEnHa0N9TAHkyNBR1VPzK_BhsaXskwMPI0qOAJRh4bSNPJAC6TJaUhCxhKdQOrQvLyx-HlNKFAEdHxTsLmOZVdBuE4BiC2WADOVRT5Bdl5wkE4d0JA5O_wUNfgXbEX1b0fBzG3FILXoQ8K6DWwDpyW__weIwtMJMclJ8w2BasS-1OJ93JB_VqxVRU6RoiZgGGkHTAYT8MmXfecr2TMtG9ReWT0rCmU2eFLr7RwwgnoWj817iAphutKNFFrxpXLEBKSkfcZCZQij2d2VrDdPWqlgITUtkKqjfJ7SmUB83g",
        "expiresIn": 3600
    }
}

Note: In the production environment, you will need to provide a list of the IP addresses that your application will use to make API requests. This ensures that only authorized IPs can access your APIs, enhancing security

PreviousAzbotPushToXBotNextInitForClient

Last updated 10 months ago

{host_url}/partner/xpbot/api/webchat/initForClient