Interface: IConversationUtil

Table of contents

Methods

Methods

getConversationById

Please be aware that the underlying Messaging Interactions API is not meant for real-time decisions, as the API has a delay of up to 1 minute.

getConversationById(conversationId, contentToRetrieve?): Promise<IConversation>

Will retrieve a conversation Object from the Live-Engage Messaging Interaction API

Parameters

Name Type Description
conversationId string ID of the conversation which should be retrieved
contentToRetrieve? ConversationContentTypes[] Array which can be used to define which contents of the conversation should be retrieved. Use const { ConversationContentTypes } = require("lp-faas-toolbelt"); to get an overview of possible options.

Returns

Promise<IConversation>


scanConversationForKeywords

scanConversationForKeywords(conversation, keywords): IKeywordScannerResult[]

Will scan a conversation Object for messages containing the provided keywords and collect them. Also it enriches them with additional information, about when the message was sent, who it was sent by and because of which keyword it was selected.

Parameters

Name Type Description
conversation any Conversation Object that has been retrieved with .getConversationById(conversationId).
keywords string[] Array of keywords which the conversation will be scanned for.

Returns

IKeywordScannerResult[]


Interface: IConversation

Properties:

  • _metadata: object
  • conversationHistoryRecords: any[]
  • Optional ttlSecond: number

Interface: IKeywordScannerResult

Properties:

  • message: string
  • sentBy: string
  • sentTimestamp: number
  • tag: string

Enumeration: LpServices

Enumeration members:

  • AGENT_PARTICIPANTS = "agentParticipants"
  • AGENT_PARTICIPANTS_ACTIVE = "agentParticipantsActive"
  • AGENT_PARTICIPANTS_LEAVE = "agentParticipantsLeave"
  • CAMPAIGN = "campaign"
  • COBROWSE_SESSIONS = "coBrowseSessions"
  • CONSUMER_PARTICIPANTS = "consumerParticipants"
  • CONVERSATION_SURVEYS = "conversationSurveys"
  • DIALOGS = "dialogs"
  • INFO = "info"
  • INTENTS = "intents"
  • INTERACTIONS = "interactions"
  • LATEST_AGENT_SURVEY = "latestAgentSurvey"
  • MESSAGE_RECORDS = "messageRecords"
  • MESSAGE_SCORES = "messageScores"
  • MESSAGE_STATUSES = "messageStatuses"
  • MONITORING = "monitoring"
  • PREVIOUSLY_SUBMITTED_AGENT_SURVEYS = "previouslySubmittedAgentSurveys"
  • RESPONSE_TIME = "responseTime"
  • SDES = "sdes"
  • SKILL_CHANGES = "skillChanges"
  • SUMMARY = "summary"
  • TRANSFERS = "transfers"
  • UNAUTH_SDES = "unAuthSdes"
  • UNIQUE_INTENTS = "uniqueIntents"