Conversation Toolkit API

lightning/conversationToolkitApi

Conversation Toolkit API is a collection of front-end API methods for interacting with the MIAW or Enhanced Messaging product using the lightning/conversationToolkitApi module. The lightning/conversationToolkitApi module requires API version 60.0 or later.

For Use In

Lightning Experience

All the methods in the lightning/conversationToolkitApi module return a promise. Required method parameters are explicitly passed as individual arguments. Optional parameters are passed into an object as the last argument of the method.

To use the Conversation Toolkit API in your component, import the functions in your component’s JavaScript file.

1import {
2  endConversation,
3  getConversationLog,
4  setAgentInput,
5  sendTextMessage,
6  setMessagingComponent,
7  sendMessagingComponent,
8  inactivateConversation,
9} from "lightning/conversationToolkitApi";

Using Conversation Toolkit API in markup via the lightning-conversation-toolkit-api component is deprecated. Use the imported functions instead. Some functions are available only by import.

Note

For this module’s documentation, see LWC Methods for Enhanced Messaging in Lightning Experience in the Console Developer Guide.

Methods 

NameDescriptionArgument NameArgument TypeArgument Description
endConversationEnds the given conversation recordrecordIdStringRecord ID for the conversation
getConversationLogReturns contents of the visible Conversation Log. Only returns Text formatted Static Content Messages.recordIdStringRecord ID for the conversation
sendTextMessageSends a new conversation text message from the agentrecordIdStringRecord ID for the conversation
messageObjectMessage to send
setAgentInputInserts the specified text content into the agent publisherrecordIdStringRecord ID for the conversation
messageObjectMessage to send
setAtCursorBooleanWhether or not to place the message at the cursor