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 clientclientId
– External client ID (for authorized clients)threadsClientId
-Internal client ID in ednareceivedAt
– Time when the message was receivedquickReplies
– Array of objects for quick repliesquickReplies.type
– The type of a quick reply. Currently onlyTEXT
is supportedquickReplies.text
– Response textquickReplies.shown_text
– Text that will be displayed to the client after they click the quick response button (instead ofquickReplies.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 URLquickReplies.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 clientreceivedAt
– Time when the message was receivedanswerId
– ID of the chatbot’s responseformattedText
– 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 ednasessionId
– Thread ID in ednaquestionId
– Internal thread ID (ID in the edna database)questionIndex
– Index of the client’s message in the threadsegmentationInfo
– Object that contains additional parameters for changing segmentation (custom segmentation parameters) after the chatbotkey
– Segmentation parameter keyvalue
– Segmentation parameter value
attachments
- Array with attachment objectsattachments.
url
- Attachment URLattachments.name
- Attachment nameattachments.type
- Attachment type
quickReplies
– Array of objects for quick repliesquickReplies.type
– The type of a quick reply. Currently onlyTEXT
is supportedquickReplies.text
– Response textquickReplies.shown_text
– Text that will be displayed to the client after they click the quick response button (instead ofquickReplies.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 URLquickReplies.url
– Link to the file in the button
code
– Used to transfer the thread to an agent. Foк that,UNCLEAR_QUESTION
orSWITCH_TO_HUMAN
must be passedsettings.blockInput
– The value that defines whether the input field is blocked (true
/false
) when using quick responsessettings.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.