Members
# appInstId
Installation identifier of a connector, server should fill that in case conversation is created by a connector
# assignedAgent
Gets the assigned agent. Returns null if none assigned or conversation is closed.
# campaignId
Brands can have multiple campaigns aimed at specific target audiences. There can be various engagements within each campaign and they can be displayed based on visitor behavior and location on the website.
# consumer
Gets the consumer. Returns null if none assigned or conversation is closed.
# handlerAccountId
In regular conversation flow both roles are fulfilled by the same account - the brand. With the Conversation Rollover functionality, however, a conversation that belongs to a brand, might be handled by a Conversation Handler account e.g. Answering service This property describe an account that currently handles the conversation.
# note
Notes about the conversation written by the agent during the conversation. Updates to this field will be permitted in CLOSE state, but not in LOCKED state.
# notificationCount
the total number of notifications processed for this conversation
# notificationIgnoredCount
the total number of notifications ignored due to no hash change
# notificationOutOfOrderCount
the total number of notifications ignored due being received out of order
# numberOfunreadMessages
Number of unread messages per participant. object {userId, # of unread messages}
# ttrEffective
Till when the agent must respond to consumer message. May be null. Takes into account values from ttr, delay, manualETTR fields during calculation
Methods
# async consumerTakeover(newConsumerUserId) → {Promise.<void>}
Allows a consumer to take over a conversation. Required after the step up process
Parameters:
Name | Type | Description |
---|---|---|
newConsumerUserId |
# getDialog(type)
Get the last updated dialog matching the type passed in
Parameters:
Name | Type | Description |
---|---|---|
type |
DialogType | the dialog type to match on |
# async join(participantRole) → {Promise.<void>}
Attempt to join the open dialog as the given role
Parameters:
Name | Type | Description |
---|---|---|
participantRole |
ParticipantRole |
# processStateNotification(state)
Takes a state notification and updates this conversation Will emit events if data has changed
Parameters:
Name | Type | Description |
---|---|---|
state |
# async queryMessages(queryopt)
Returns all messages from this dialog, optionally accepts a query to filter.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
query |
object |
<optional> |
optional query to filter messages |
maxQuantity |
string |
<optional> |
maximum number of messages to return |
sequenceMin |
string |
<optional> |
messages older than the provided sequence number, inclusive |
sequenceMax |
string |
<optional> |
messages newer than the provided sequence number, inclusive |
# async sendMessage(text, metadataopt, quickRepliesopt) → {Promise.<void>}
Sends a message to the open dialog in the conversation
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
string | Message text, max length 8,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | A metadata object or an array of metadata objects, must conform to valid metadata schema |
quickReplies |
Object |
<optional> |
null | An object conforming to the quick replies schema |
# async sendPrivateMessage(text, metadataopt) → {Promise.<void>}
Sends a private message on the open dialog, only agents and agent managers can see these messages
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
string | Message text, max length 8,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | A metadata object or an array of metadata objects, must conform to valid metadata schema |
# async sendRichText(message, metadataopt, quickRepliesopt) → {Promise.<void>}
Sends a structured content on the open dialog
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
message |
Object | Structured content or rich text, max length 15,000 characters |
||
metadata |
Object | Array.<Object> |
<optional> |
null | A metadata object or an array of metadata objects, must conform to valid metadata schema |
quickReplies |
Object |
<optional> |
null | An object conforming to the quick replies schema |
# async setAgentNote(noteContent, agentIdopt, nameopt, noteIdopt, isAutoSummaryopt, truncateEnabledopt) → {Promise.<{truncated: boolean, truncatedText: string}>}
Updates the conversation's note field, retaining existing notes
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
noteContent |
string | The note text |
|
agentId |
string | null |
<optional> |
Agent ID. If null, defaults to the userId of the connection |
name |
string | null |
<optional> |
Agent name. If null, defaults to the agent name of the connection |
noteId |
string | null |
<optional> |
agentId::timeInMs |
isAutoSummary |
boolean |
<optional> |
Indicates if the note is an automated summarization |
truncateEnabled |
boolean |
<optional> |
Defaults to true where notes with more than 5000 characters will be truncated |
- No room left to add agent note
- If truncated is true, truncatedText is the noteContent after truncation
# async setCsat(csatRate, csatResolutionConfirmation, csatStatusopt) → {Promise.<void>}
Updates csatRate
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
csatRate |
string | |||
csatResolutionConfirmation |
boolean | |||
csatStatus |
CsatStatus |
<optional> |
csatStatus.FILLED |
# async setManualETTR(time) → {Promise.<void>}
Sets the manual time to respond for the conversation, only supported for brand connections
Parameters:
Name | Type | Description |
---|---|---|
time |
Number | time to respond in timestamp format |
# async setNote()
- Deprecated:
- Replaced by setAgentNote
# async setTTR(ttrType, valueopt) → {Promise.<void>}
Sets TTR for the conversation
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ttrType |
TTRType | |||
value |
Number |
<optional> |
0 | TTR value in seconds. This value is only updatable when ttrType is CUSTOM. For all other types, the value is assigned by the system. |
# async transfer(argsopt)
Transfers the conversation to another agent, skill, or both. Removes the ASSIGNED_AGENT from the conversation.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
object |
<optional> |
Object containing agentId or skillId. Defaults to an empty Object |
agentId |
string |
<optional> |
Transfers this conversation to the specified agentId |
skillId |
string |
<optional> |
Transfers this conversation to the specified skillId |
void
# unload()
Unloads this conversation from memory, only works on a previously deserialized conversation that was loaded with connection.loadConversation
# async uploadFile(buffer, captionopt) → {Promise.<void>}
Refer to this documentation to enable file sharing. Uploads a file and publishes the upload event on the open dialog
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
buffer |
ArrayBuffer | buffer of the file to be uploaded |
|
caption |
string |
<optional> |
a caption for the file |
Events
# dialog:close
Dialog has closed
Parameters:
Name | Type | Description |
---|---|---|
dialogState |
object | |
state |
string | the current dialog state |
metaDataLastUpdateTs |
number | the timestamp of that time the dialog was updated |
participantDetails |
Array | a collection of the participants joined on the dialog |
# back-to-queue
The conversation was sent back to queue. This happens when an assigned agent is removed, there is no new assigned agent to replace them, and there was not a skill change
# consumer-step-up
Consumer has been removed and then replaced with a different userId, indicating a consumer step-up event.
# group-change
Agent group changed for the conversation
Parameters:
Name | Type | Description |
---|---|---|
groupInfo |
object | |
prevGroupId |
string | old groupId |
newGroupId |
string | new groupId |
# manual-ettr-change
Agent changed the time to respond for the conversation
Parameters:
Name | Type | Description |
---|---|---|
manualEttrChange |
object | |
ttrEffectiveManual |
number | time to respond in timestamp |
ttrEffective |
number | time to respond in timestamp |
# participant-added
An active participant was added to the dialog
Parameters:
Name | Type | Description |
---|---|---|
addedParticipant |
object | |
participant |
Participant | the participant added |
context |
object | the context in which the participant was added |
context.previouslySuggested |
boolean | the participant went from the state 'suggested' to 'active' |
# participant-removed
An active participant was removed from the dialog
Parameters:
Name | Type | Description |
---|---|---|
participant |
Participant | the participant removed |
# participant-suggested
A participant was added to the dialog with a state of 'suggested'
Parameters:
Name | Type | Description |
---|---|---|
participant |
Participant | the participant suggested |
# participant-suggested-removed
A participant with the state of 'suggested' was removed from the dialog
Parameters:
Name | Type | Description |
---|---|---|
participant |
Participant | the participant removed |
# transfer-agent
The conversation was transferred to a new agent. This happens when an agent is added with a state of 'suggested'
Parameters:
Name | Type | Description |
---|---|---|
participant |
Participant | the agent transferred to |
# transfer-skill
The skill has changed and previous agent is unassigned, indicating a skill transfer
Parameters:
Name | Type | Description |
---|---|---|
skillTransfer |
object | |
skillId |
string | the skillId transferred to |
# ttr-change
Consumer changed the time to respond for the conversation
Parameters:
Name | Type | Description |
---|---|---|
ttrChange |
object | |
ttrValue |
number | time to respond in seconds |
ttrType |
string | the type of time to respond e.g. PRIORITIZED |
ttrEffective |
number | time to respond in timestamp |