Explore Knowledge Base

Chats

02. 01. 2025

The “Chats” feature in SDK.finance enhances user engagement and support by enabling direct, transaction-linked communication. This functionality provides an efficient and seamless chat experience for users and support staff within the SDK.finance platform.

Please check the Chats feature in the Back Office manual. 

Key Features

Transaction-Linked Communication

  • Each chat session is directly associated with a specific transaction, ensuring context is preserved.
  • Service Users can initiate chats directly from the transaction interface, allowing support staff to access all relevant transaction details seamlessly.

Module Capabilities and Data Hierarchy

The conversation module is built around the Ticket (TransactionTicket) class, which serves as the top-level entity in the data hierarchy. This class is pivotal in linking each chat session directly to its corresponding financial transaction, ensuring a coherent data structure and facilitating efficient information retrieval.

  • Ticket (to be TransactionTicket): Acts as the root entity. Each ticket will encapsulate the details of a transaction and is directly associated with one or more Conversation instances, providing a structured pathway from transaction details to interactive support dialogues.
  • Conversation: Nested within TransactionTicket, this entity manages the communication threads related to the transaction. Each conversation can engage multiple participants, encompassing users and support personnel.
  • Participant: A sub-entity within Conversation, representing each user involved in the chat. This class handles the specifics of participant roles and states within a conversation.
  • Message and ParticipantMessage: These entities operate within the scope of a Conversation, with Message handling the storage and management of all chat messages. ParticipantMessage extends the functionality by linking messages directly to their respective senders, adding the chat history with context about the sender and message status.

This hierarchical structure facilitates a clear and organized representation of chat sessions and their linkage to specific transactions.

Service Users’ capabilities:

Service users with appropriate permissions are able to create chat with the chosen business user, view list of existing chats, view messages in chat, write message in the chat, and delete chat.

For this purpose there’s a filter parameters in the /api/v1/conversations/view: participantId and participantType

    1. Participant ID Filtering:
  • If participantId is provided but participantType is not, the filter includes:
  • Participants where the user.id matches the provided participantId, or
  • Participants where the organization.id matches the provided participantId.

 

  1. Participant Type Filtering:
  • If participantType is provided, an additional filter is applied to ensure the participant’s type matches the specified value.

APIs for this Use case:

Support

Get the list of chats

Create chat

 

(COMING SOON) Service Users with appropriate permission, are able to initiate a chat with a business user related to the chosen transaction in which the wallet of this business user is participating, view this chat in the list of chats, view messages in this chat, and add messages to this chat. 

Roles to initiate chat related to the transactions:

  • All roles with permissions SYSTEM_BROADCAST_CREATION_EXECUTOR

Conditions:

  • Service user with appropriate permission can create chat related to the transaction with the business user if the wallet of this business user is participating in the transaction
  • Only one chat with the same business user can exist for one transaction
  • If chat related to the transaction with business user already exists message should be added to the existing chat
  • Service user can view chat related to the transaction in the list of chats (POST /v1​/conversations​/view)
  • Service user can view messages in the chat related to the transaction (POST /v1​/conversations​/{conversationId}​/messages)

API POST /v1​/conversations​/{conversationId}​/messages/view is used to view messages 

API POST /v1​/conversations​/{conversationId}​/messages is used to add messages