Livechat Realtime API
    • Dark
      Light
    • PDF

    Livechat Realtime API

    • Dark
      Light
    • PDF

    Article summary

    This API is intended to be used for having a Livechat conversation.

    • First, you need to generate a visitor token (it can be any random string).

    • Call livechat:getInitialData passing visitorToken as the first argument, the response will be an object containing a Livechat configuration object with the following properties:

    Field

    Type

    Description

    enabled

    Boolean

    Whether Livechat is enabled for that workspace or not.

    title

    String

    The Livechat widget title.

    color

    Hexadecimal

    The hexadecimal color of the Livechat widget title bar when Livechat is online.

    registrationForm

    Boolean

    If the registration form should be displayed or not..

    room

    Object

    The current conversation room for the current guest user

    visitor

    Object

    The current guest user.

    triggers

    Array

    Array of Livechat triggers.

    departments

    Array

    Array of Livechat departments.

    allowSwitchingDepartments

    Boolean

    If client-side department switching is allowed.

    online

    Boolean

    If there are Livechat agents online.

    offlineColor

    Hexadecimal

    The hexadecimal color of the Livechat widget title bar when Livechat is offline.

    offlineMessage

    String

    The message that will be displayed on the Livechat offline form.

    offlineSuccessMessage

    String

    The message that will be displayed after sending a message using the offline form.

    offlineUnavailableMessage

    String

    The message that will be displayed when Livechat is offline.

    displayOfflineForm

    Boolean

    If the offline form will be displayed when Livechat is offline.

    videoCall

    Boolean

    If the VideoCall feature is available.

    conversationFinishedMessage

    Boolean

    The system message that will be sent to the current guest user when the conversation is closed.

    nameFieldRegistrationForm

    Boolean

    If the name field is displayed on the Livechat registration form.

    emailFieldRegistrationForm

    Boolean

    If the email field is displayed on the Livechat registration form.

    offlineTitle

    String

    The title of the widget when Livechat is offline.

    language

    String

    The default user language to be set in the Livechat widget.

    transcript

    Boolean

    If the Livechat widget will ask the current guest user if they would like a transcript after the conversation is closed.

    transcriptMessage

    String

    The message to be displayed when asking about the transcript.

    agentData

    Object

    The current agent attending the chart.

    • Call livechat:registerGuest to register guests and get the response containing the visitor's data.

    • Before sending the first message, you have to generate a random room _id.

    • Now you can send messages to the method sendMessageLivechat.

    • Subscribe to: stream-room-messages and stream-livechat-room.

    • Get agent info by calling livechat:getAgentData.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence