Sign In
Sign In
  1. Home
  2. APIs
  3. Widget Javascript API
  4. Available methods
APIs
37 articles
WhatsApp Push v1.03
Agent Handover v1.04
Data Compliance API4
Widget Javascript API4
Introduction
Available methods
Widget events
Widget Attributes
Message Trigger v1.12
Messaging v1.14

Available methods

Lists the available API methods and endpoints exposed for integrating with the Laiye Chatbot platform.

Updated on September 24, 2026

Method

Description

isOpen

DestygoChat.isOpen() returns true if the widget chatbox is open and false if not.

wasOpened

DestygoChat.wasOpened() returns true if the widget chatbox has been opened once before and false if not.

unreadMessagesCount

DestygoChat.unreadMessagesCount() returns the number of unread messages. A message is unread if it was received while the chatbox was closed and has not been opened since.

messages

DestygoChat.messages() returns the list of messages of the current widget. The result is an array with the two following object possibilities: { "author": "'user'||'server'", "text": "the text of the message" } { "author": "'user'||'server'", "attachment": {type: "template", payload: {…}} } Author can be user or server. There will be either text or attachment in the payload. An attachment is a template JSON data.

MarkMessagesAsRead

DestygoChat.MarkMessagesAsRead() marks all unread messages as read.

ToggleChat

Optional parameter : open (boolean) DestygoChat.ToggleChat() opens or closes the chatbox depending of its parameter. * DestygoChat.ToggleChat() will open the chatbox if it was closed, and close it if it was opened. * DestygoChat.ToggleChat({open: true}) will open the chatbox no matter what the state is. * DestygoChat.ToggleChat({open: false}) will close the chatbox no matter what the state is.

SendMessage

Mandatory parameter : text message (string) DestygoChat.SendMessage('a text message') will send a text message to the bot.

ResetWidget

DestygoChat.ResetWidget() resets the widget state, as if it was a brand new user.

setZendeskUserInfo

Mandatory parameter : User informations : display_name, email, phone (Object) The object parameter can handle only these three parameters: display_name, email, phone. This restriction comes from Zendesk and we cannot add any other fields. DestygoChat.setZendeskUserInfo(UserInfoObject) will send the user informations to Zendesk before the agent handover. You need to use this function when the following event is triggered: destygo_zendesk_triggered

Was this article helpful?

Made from France 💙

Categories

  • ANALYTICS
  • BUILD
  • LOUIS AI
  • INTEGRATE

🔗 Useful Links

  • Sign In
  • Website
  • Terms & Conditions

© 2026

MindsayPowered by Mindsay

Search the help center…

Search help center articles