Destroys this Conversation API instance.
Calling destroy unregisters all event listeners and prohibits any further calls to this object. Once the Conversation is destroyed, any subsequent calls reject the returned promise with UnbluErrorType.ILLEGAL_STATE as the reason.
Destroying a Conversation API instance does NOT:
A conversation that's still connected but whose Conversation API instance has been destroyed can be accessed again using getActiveConversation.
Disconnects this conversation locally. Calling the method closes the connection to the conversation.
If a web component displayed the conversation it will close the conversation there as well and will navigate back to the default UI route.
The agent can rejoin the conversation either via the UI or using connectConversation.
Empty once the conversation has been disconnected
UnbluApiError if the call fails
Ends the conversation.
Empty once the conversation has been ended
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person doesn't have permission to end the conversation
UnbluApiError if the call fails
Forwards the conversation to another agent. Once the forwarding is accepted, the target agent becomes the assigned agent of the conversation, and the current assigned agent leaves the conversation.
The options for the forwarding
Empty once the conversation has been forwarded
UnbluApiError if the call fails
Forwards the conversation back to the queue for a specific named area. Once the forwarding is accepted, the current assigned agent leaves the conversation.
The options for the forwarding
Empty once the conversation has been forwarded
UnbluApiError if the call fails
Forwards the conversation to a team. Any agent of the team can accept the forwarding. Once the forwarding is accepted, the accepting agent becomes the assigned agent of the conversation, and the current assigned agent leaves the conversation.
The options for the forwarding
Empty once the conversation has been forwarded
UnbluApiError if the call fails
Gets the local participant's call connection state for the conversation's currently active call. Refer to CallConnectionState for possible states.
The current call connection state of the conversation, or CallConnectionState.DISCONNECTED if there's no active call
CALL_CONNECTION_STATE_CHANGE if you need to listen to changes.
UnbluApiError if the call fails
Gets the conversation's call state for the local participant. Refer to CallState for possible states.
The current call state of the local participant
CALL_STATE_CHANGE if you need to listen to changes
Returns an immutable snapshot of all the collaboration layers currently present in the conversation, independent of their state. As a conversation unfolds, its collaboration layers can change based on participants and configuration. Subsequent calls to the method may therefore return a different collection.
The collaboration layers of the conversation
UnbluApiError if the call fails
Returns the access type the agent is connected to the conversation with.
Returns the conversation's current connection state.
If the connection is lost, the conversation automatically tries to reconnect using an exponential back-off strategy.
If a fatal error is detected, the conversation's connection state changes to ConnectionState.ERROR. When this happens, the conversation is in its terminal state. A dialog or other UI is displayed to the user with details of the failure.
The conversation is not automatically closed after a fatal error. It may be closed through either manual action by the agent (confirming the error) or the API.
The current connection state of the conversation
CONNECTION_STATE_CHANGE if you need to listen to changes.
UnbluApiError if the call fails
Returns the ID of the conversation
Returns a list of links to open the conversation in different Unblu UIs
The list of links to open the conversation
UnbluApiError if the call fails
Returns the current conversation state.
The current state of the conversation
UnbluApiError if the call fails
Retrieves all custom conversation actions currently available in the conversation for the user
The custom conversation actions
Retrieves all custom person actions currently available in the conversation for the user
The custom person actions
Gets the currently displayed collaboration layer. The returned value is null if no layer is displayed.
The currently displayed collaboration layer of the conversation, or null if no layer is displayed
DISPLAYED_COLLABORATION_LAYER_CHANGE if you need to listen to changes.
UnbluApiError if the call fails
Gets the metadata of the conversation. Metadata access must be allowed in the conversation's configuration.
The metadata of the conversation
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if accessing the metadata is not permitted
UnbluApiError if the call fails
Returns the list of current participants in the conversation. As participants can join and leave a conversation, subsequent calls may return a different collection.
The list of the conversation's current participants
PARTICIPANTS_CHANGE if you need to listen to changes.
UnbluApiError if the call fails
Gets the custom visitor data of the conversation.
The custom visitor data of the conversation
UnbluApiError if the call fails
Invites an agent to the conversation
The options for the invitation
Empty once the agent has been invited
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to invite other agents
UnbluApiError if the call fails
Invites a team to the conversation. Any agent of the team can accept the invitation and join the conversation.
The options for the invitation
Empty once the team has been invited
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to invite teams
UnbluApiError if the call fails
Invites a visitor to the conversation by email. The visitor receives an email with a link to the conversation.
The options for the invitation
Empty once the invitation email has been sent
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to invite visitors by email
UnbluApiError if the call fails
Creates a link which can be transmitted to a visitor to invite or add them to the conversation.
OptionalvisitorInviteByLinkOptions: VisitorInviteByLinkOptionsThe options for the invitation
The link to invite the visitor
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to create invitation links
UnbluApiError if the call fails
Creates a PIN which can be transmitted to a visitor to invite or add them to the conversation.
OptionalvisitorInviteByPinOptions: VisitorInviteByPinOptionsThe options for the invitation
The PIN to invite the visitor
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to invite with PIN
UnbluApiError if the call fails
Returns whether this Conversation API instance is destroyed or not.
Conversation API instances are destroyed if destroy is called or the conversation is disconnected. This usually happens when the user navigates back to an overview or into another conversation.
Whether this Conversation is destroyed or not.
Leaves and disconnects the conversation.
By leaving, the agent is removed from the active participant list of the conversation. Once an agent leaves a conversation, they can't reconnect to it, and it isn't visible in their conversation history.
Empty once the conversation has been left
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person doesn't have permission to leave the conversation
UnbluApiError if the call fails
Removes a previously registered listener.
The event to unregister from.
The listener to remove.
Registers an event listener for the given event.
The call state change event.
The listener to be called.
Registers an event listener for the given event.
The conversation state change event.
The listener to be called.
Registers an event listener for the given event.
The call state change event.
The listener to be called.
Registers an event listener for the given event
The call connection state change event
The listener to be called
Registers an event listener for the given event
The collaboration layers change event
The listener to be called
Registers an event listener for the given event
The participants change event
The listener to be called
Registers an event listener for the given event
The displayed collaboration layer change event
The listener to be called
Registers an event listener for the given event.
The customActionInvocation event.
The listener to be called.
Registers an event listener for the given event.
The customConversationActionsChanged event.
The listener to be called.
Registers an event listener for the given event.
The customPersonActionsChanged event.
The listener to be called.
Removes the given person from the conversation. The person will go through the "User removed" offboarding flow.
The ID of the person to remove
Empty once the person has been removed
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to remove the person
UnbluApiError if the call fails
Sends the specified message in this conversation on behalf of the current agent.
The message to send
Empty once the message has been sent
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the required permissions aren't granted
UnbluApiError with type UnbluErrorType.INVALID_FUNCTION_ARGUMENTS if the message's content is invalid
UnbluApiError if the call fails
Sets a new assigned agent for the conversation. The current assigned agent remains in the conversation as a secondary agent.
The options for setting the new assigned agent
Empty once the assigned agent has been set
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to set the assigned agent
UnbluApiError if the call fails
Starts a video call in the conversation. The call is ignored if there's already an active call.
Empty once the call has been started
CALL_STATE_CHANGE If you need to listen to changes.
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to start a video call
UnbluApiError if the call fails
Starts an audio call in this conversation. The call is ignored if there's already an active call.
Empty once the call has been started
CALL_STATE_CHANGE If you need to listen to changes.
UnbluApiError with type UnbluErrorType.ACTION_NOT_GRANTED if the local person isn't allowed to start a voice call
UnbluApiError if the call fails
Triggers the given custom conversation action in the conversation
The ID of the custom conversation action to trigger
Empty once the trigger has been sent. It doesn't mean the custom action was executed anywhere yet.
UnbluApiError if the trigger fails
Triggers the given custom person action in the conversation
The ID of the custom person action to trigger
The ID of the person for whom the action should be triggered
Empty once the trigger has been sent. It doesn't mean the custom action was executed anywhere yet.
UnbluApiError if the trigger fails
Static ReadonlyCALL_Event emitted when the CallConnectionState of the conversation changes callConnectionStateChange
on for listener registration
Static ReadonlyCALL_Event emitted when the CallState of this conversation changes. callStateChange
on for listener registration
Static ReadonlyCONNECTION_Event emitted when the ConnectionState of this conversation changes. connectionStateChange
on for listener registration
Static ReadonlyCONVERSATION_Event emitted when the ConversationState of this conversation changes. conversationStateChange
on for listener registration
Static ReadonlyCUSTOM_Event emitted every time a custom action was invoked and is executed on the current integration
customActionInvocation
Static ReadonlyCUSTOM_Event emitted every time the custom conversation actions in the conversation change
customConversationActionsChanged
Static ReadonlyCUSTOM_Event emitted every time the custom person actions in the conversation change *
Static ReadonlyDISCONNECTEvent emitted when the conversation is disconnected.
This may happen due to a UI-navigation or an API-call.
Note: The event isn't triggered if the conversation is disconnected by the server.
disconnect
on for listener registration
Static ReadonlyDISPLAYED_Event emitted when the displayed CollaborationLayer of the conversation changes displayedCollaborationLayerChange
on for listener registration
Static ReadonlyPARTICIPANTS_Event emitted when the CurrentConversationParticipants of the conversation change, that is, when:
on for listener registration
This class gives API access to a connected conversation.
As long as a conversation is connected, one can register and receive the events provided by this class and call the methods. Once the conversation is disconnected this API object will be destroyed and no more event callbacks will be called. Any subsequent function calls will fail.
Use the UnbluConversationConnectionsApi.CONVERSATION_DISCONNECTED event to deinitialize all code associated with this conversation. The DISCONNECT event can also be used, but it may not be triggered in all situations.