Chatbot Capabilities

In this article, we will cover what edna allows a chatbot to do via API.

Proactive Greeting

After a chat with a client is initialized, a chatbot can send them a message and engage them in a dialog without waiting for them to start the conversation first. The Greet method is used for that.

  • text – Bot’s reply to the message from the client
  • clientId – External client ID (for authorized clients)
  • threadsClientId -Internal client ID in edna
  • receivedAt – Time when the message was received
  • quickReplies – Array of objects for quick replies
    • quickReplies.type – The type of a quick reply. Currently only TEXT is supported
    • quickReplies.text – Response text
    • quickReplies.shown_text – Text that will be displayed to the client after they click the quick response button (instead of quickReplies.text). This parameter is optional.
    • quickReplies.callback_data – An event that the chat widget passes to the API if the clients clicks the button. If you specify this attribute, the system will call a JS SDK API method, ThreadsWidget.on.
    • quickReplies.imageUrl – Button icon URL
    • quickReplies.url – Link to the file in the button
  • settings.blockInput – The value that defines whether the input field is blocked (true/false) when using quick responses

Sending Messages, Transferring Threads to Agents

After a chat is assigned to a chat bot, it can respond to the client’s messages. For that, the Post answers method is used.

  • text – Bot’s reply to the message from the client
  • receivedAt – Time when the message was received
  • answerId – ID of the chatbot’s response
  • formattedText – Bot’s reply to the message from the client. The reply might contain Markdown syntax. 
  • clientId – External client ID (for authorized client)
  • threadsClientId – Internal client ID in edna
  • sessionId – Thread ID in edna
  • questionId – Internal thread ID (ID in the edna database)
  • questionIndex – Index of the client’s message in the thread
  • segmentationInfo – Object that contains additional parameters for changing segmentation (custom segmentation parameters) after the chatbot
    • key – Segmentation parameter key
    • value – Segmentation parameter value
  • attachments - Array with attachment objectsattachments.
    • url - Attachment URL
    • attachments.name - Attachment name
    • attachments.type - Attachment type
  • quickReplies – Array of objects for quick replies
    • quickReplies.type – The type of a quick reply. Currently only TEXT is supported
    • quickReplies.text – Response text
    • quickReplies.shown_text – Text that will be displayed to the client after they click the quick response button (instead of quickReplies.text). This parameter is optional.
    • quickReplies.callback_data – An event that the chat widget passes to the API if the clients clicks the button. If you specify this attribute, the system will call a JS SDK API method, ThreadsWidget.on.
    • quickReplies.imageUrl – Button icon URL
    • quickReplies.url – Link to the file in the button
  • code – Used to transfer the thread to an agent. Foк that, UNCLEAR_QUESTION or SWITCH_TO_HUMAN must be passed
  • settings.blockInput – The value that defines whether the input field is blocked (true/false) when using quick responses
  • settings.masked – Parameter that is used to mask digits in the linked client message (true/false)

Closing Threads

A chatbot can close the thread by itself without transferring it to an agent. For that, the chatbot needs to use the Close Threads by Bot or Close Threads by Bot with Comment methods.

Hints for Agents

A chatbot can work in prompter mode. For example, if an agent is processing a thread, the chatbot can use the Hints method and send the agent some hints that are appropriate for their response to the client. These hints will be displayed in the agent WP on the Hints tab when clicking the Use response templates button.