AxpMessagingConversationTrait is an interface that provides definition for the messaging conversation functionality.

interface AxpMessagingConversationTrait {
    addMessageArrivedListener(handler: EventHandler<MessageEvent>): string;
    addMessageDeliveredListener(handler: EventHandler<MessageEvent>): string;
    addTypingStartedListener(handler: EventHandler<TypingStarted>): string;
    addTypingStoppedListener(handler: EventHandler<TypingStopped>): string;
    getMessages(pageSize: number): Promise<PageIterator<Message>>;
    notifyUserTyping(): void;
    removeMessageArrivedListener(handlerId: string): void;
    removeMessageDeliveredListener(handlerId: string): void;
    removeTypingStartedListener(handlerId: string): void;
    removeTypingStoppedListener(handlerId: string): void;
    sendMessage(message: MessageRequest): Promise<Message>;
}

Methods

  • Attach event handler callback that needs to be invoked when a message is received from Agent/Supervisor/Bot.

    Parameters

    Returns string

    string Unique EventHandlerId that was generated by SDK when the event handler was attached.

  • Attach event handler callback that needs to be invoked when a client message is delivered to Agent/Supervisor/Bot.

    Parameters

    Returns string

    string Unique EventHandlerId that was generated by SDK when the event handler was attached.

  • Attach event handler callback that needs to be invoked when a participant (other than this user) has started typing.

    Parameters

    Returns string

    string Unique EventHandlerId that was generated by SDK when the event handler was attached.

  • Attach event handler callback that needs to be invoked when a participant (other than this user) has stopped typing.

    Parameters

    Returns string

    string Unique EventHandlerId that was generated by SDK when the event handler was attached.

  • Get older messages exchanged in the conversation.

    Parameters

    • pageSize: number

      The number of messages to be fetched.

    Returns Promise<PageIterator<Message>>

    A promise that resolves to a page iterator that can be used to fetch messages.

  • This method essentially acts like a beacon. Call this method while the user is typing to notify the Contact Center about the user's typing activity. For example, call this method on every input change or key down events.

    Returns void

  • Remove the event handler callback that was attached to the message arrived event.

    Parameters

    • handlerId: string

      Unique EventHandlerId that was generated by SDK when the event handler was attached.

    Returns void

  • Remove the event handler callback that was attached to the message delivered event.

    Parameters

    • handlerId: string

      Unique EventHandlerId that was generated by SDK when the event handler was attached.

    Returns void

  • Remove the event handler callback that was attached to the typing started event.

    Parameters

    • handlerId: string

      Unique EventHandlerId that was generated by SDK when the event handler was attached.

    Returns void

  • Remove the event handler callback that was attached to the typing stopped event.

    Parameters

    • handlerId: string

      Unique EventHandlerId that was generated by SDK when the event handler was attached.

    Returns void

  • Send message to contact center (agent/bot/supervisor).

    Parameters

    Returns Promise<Message>

    A promise that resolves to the message that was sent.