Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

getEnhancedConversationLog() for LWC for Lightning Experience

Retrieves a full conversation log for a Messaging session. This method works only in Lightning console apps where the conversation component is rendered.

This method returns conversation entries in a Messaging session. If a conversation was closed and reopened later, the method fetches entries from the previous session and the current session, as they belong to the same conversation. Use this method to capture transcripts that might otherwise be lost during network interruptions. Supported conversation entry types include outbound messages, inbound messages, messaging components, attachments, notes (whisper messages) and events (Consult Conversation Info, End User Consent Updated, Flag Raised and Flag Lowered, Message Delivery Failed, Participant Changed, Routing Result, Session Status Changed).

This method returns conversation entries that are currently loaded in the rendered conversation component in a Lightning app page. It queries the in-memory state of the UI component and doesn't fetch the complete conversation history directly from Salesforce. Because the conversation component implements pagination with scroll-based lazy loading, this method may not fetch the complete conversation history when the conversation is more than 200 entries long.

Note

Arguments

Name Type Description
recordId String The ID of the record for the Messaging session.

Response

Returns a Promise. Success resolves to a detailed entries response object. The Promise is rejected if there's an error.

Name Type Description
entries Array of entry objects. An array of entry objects containing all of the available conversation entries (messages from the conversation log).

entry

The entry object that contains a message from the conversation log.

Name Type Description
entryPayload Object A JSON payload whose structure depends on the entry type. For more information, see Conversation Entry Payload Schema in the Messaging Object Model and Data Access Guide.
identifier String The ID of the conversation entry.
sender Object The JSON serialized payload with data that contains the participant that sent the message, including this information:
  • role: Indicates who sent the entry (agent, end user, etc.)
  • app: Indicates the channel where the entry was sent (agent, chatbot, whatsapp, etc.)
  • subject: Specifies the ID of the sender
senderDisplayName String The name of the user who sent the message in the conversation log. This name appears exactly as it is displayed in the conversation.
transcriptedTimestamp String The date and time when a conversation entry was persisted in the Salesforce conversation transcript. Stored as a Unix epoch timestamp in milliseconds. This value is different from the clientTimestamp when the message was originally created. If clientTimestamp is not provided, it defaults to transcriptedTimestamp.

Example Response

1{
2  "identifier": "eead2391-d62e-451b-bfce-188dc8b2fd72",
3  "senderDisplayName": "bob",
4  "sender": {
5    "app": "AGENT",
6    "subject": "005SG00000PciMc",
7    "role": "AGENT"
8  },
9  "entryPayload": {
10    "entryType": "Message",
11    "id": "eead2391-d62e-451b-bfce-188dc8b2fd72",
12    "abstractMessage": {
13      "messageType": "StaticContentMessage",
14      "inReplyToMessageId": null,
15      "customHandlingType": null,
16      "id": "eead2391-d62e-451b-bfce-188dc8b2fd72",
17      "references": [],
18      "contentCategory": null,
19      "staticContent": {
20        "formatType": "Text",
21        "text": "hello",
22        "citationContent": null
23      }
24    },
25    "messageReason": null,
26    "wasRevised": null
27  },
28  "transcriptedTimestamp": 1782923105953
29}