...
- chatSessionStarted - Оператору пришла новая сессия чата (при этом не факт, что оператору, может быть просто в помощь)
Блок кода language javascript title chatSessionStarted collapse true chatSessionStarted: { event: 'chatSessionStarted', data: { id: string; chatId: string; clientId: string | null; name: string; markedAsSpam: boolean; operatorId: string | number | null; operatorType?: string; channel: string; botStatus?: string | null; status: string; startedAt: string; clientOnlineAt?: string | null; clientOfflineAt?: string | null; lastMessageCreatedAt: string | null; lastMessage?: Unknown | null; clientExternalId?: string | null; clientBanned?: boolean | null; referer?: string; clientIp?: string | null; coordinates?: { city?: string | null; latitude?: number | null; zip_code?: string | null; longitude?: number | null; time_zone?: string | null; region_name?: string | null; country_code?: string | null; country_name?: string | null; } | null; unreadClientMessageCount?: number | null; unreadClientMessageExists?: boolean | null; messengerType?: string | null; whatsappPhone?: string | null; timerFirstAnswer?: number; timerNextAnswers?: number; lastOperatorMessage?: Unknown | null; firstClientMessageAfterLastOperatorMessage?: Unknown | null; operatorAssignedAt: string | null; previousOperator?: { id?: string | null; name?: string | null; } | null; } } - operatorNotFound - Сессия не нашла оператора и упала в помощь
- chatSessionAdded - Сессия пришла оператору
- chatMessageCreated - Оператору пришло новое сообщение в чате
- chatMessageEdited - Кто-то из операторов изменил сообщение в чате
- chatMessageRead - Оператору пришло сообщение, что клиент прочитал сообщение в чате
- chatSessionDeleted - Есть кейсы, когда сессия после отправки определенного сообщения уходит на бота - и тогда пропадает у оператора
- chatSessionSwitchedFromBotToOperator - Сессия была переключена с бота на оператора
- sessionClosedByClient - Клиент закрыл сессию
- operatorBlocked - Оператора заблокировали на платформе — требуется выкинуть оператора из кабинета
- chatUserExists - Кто-то зашел в текущего оператора. Текущий сеанс оператора нужно закрыть
- typing - пользователь печатает сообщение в чате
- operatorLoggedOut - сделать оператора офлайн
- clientOnline - клиент стал онлайн
- clientOffline - клиент стал офлайн
Подробное описание данных в событиях
Блок кода language javascript title operatorNotFound collapse true operatorNotFound: { action: 'operatorNotFound'; data: { botStatus: string; // например, 'HELP' chatId: string; operatorType: string; sessionId: string; status: string; }; }- chatSessionAdded - Сессия пришла оператору
Блок кода language javascript title
...
chatSessionAdded collapse true
...
chatSessionAdded: { action: 'chatSessionAdded'; data: {
...
id: string; chatId: string; clientId: string | null;
...
name: string;
...
markedAsSpam: boolean;
...
operatorId: string | number | null; operatorType?: string;
...
channel: string;
...
botStatus?: string | null;
...
| language | javascript |
|---|---|
| title | chatSessionAdded |
| collapse | true |
...
...
...
status:
...
string;
...
...
startedAt: string;
...
clientOnlineAt?: string | null;
...
clientOfflineAt?: string | null;
...
lastMessageCreatedAt: string | null;
...
lastMessage?:
...
Unknown | null;
...
clientExternalId?: string
...
| null;
...
clientBanned?: boolean |
...
null;
...
referer?: string;
...
clientIp?: string | null;
...
coordinates?:
...
{
...
city?: string | null;
...
latitude?:
...
number | null;
...
zip_code?: string | null;
...
longitude?:
...
number | null;
...
time_zone?:
...
string | null;
...
region_name?: string | null;
...
country_code?:
...
string | null;
...
country_name?: string | null;
...
} | null;
...
unreadClientMessageCount?: number
...
| null;
...
unreadClientMessageExists?:
...
boolean | null;
...
messengerType?:
...
string | null;
...
whatsappPhone?: string | null;
...
timerFirstAnswer?: number
...
;
...
timerNextAnswers?:
...
number;
...
lastOperatorMessage?:
...
Unknown | null;
...
firstClientMessageAfterLastOperatorMessage?:
...
Unknown | null;
...
...
operatorAssignedAt: string | null;
...
previousOperator?: {
...
id?:
...
string | null;
...
name?:
...
string | null;
...
} | null
...
; }; }- chatMessageCreated - Оператору пришло новое сообщение в чате
Блок кода language javascript title chatMessageCreated collapse true chatMessageCreated: { action: 'chatMessageCreated'; data: {
...
id:
...
string;
...
sessionId:
...
string;
...
clientId: string | null;
...
authorId:
...
string;
...
authorType: string
...
;
...
authorName: string | null;
...
type: 'REGULAR' |
...
'TERMINAL';
...
| language | javascript |
|---|---|
| title | chatMessageCreated |
| collapse | true |
...
body: string; attachments: unknown[]; createdAt: string;
...
updatedAt?: string | null;
...
readAt?: string | null;
...
deletedAt?: string | null;
...
actions?:
...
unknown[];
...
replyTo?:
...
{
...
id: string
...
;
...
authorType:
...
string; body: string; attachments: unknown[];
...
authorName: string | null;
...
} | null;
...
history?:
...
{
...
editedAt?: string | null;
...
}[]; }
...
replyToMessage?: {
...
id: string;
...
authorType: string;
...
body: string;
...
attachments: unknown[];
...
authorName: string | null;
...
} | null;
...
}- chatMessageEdited - Кто-то из операторов изменил сообщение в чате
Блок кода language javascript title chatMessageEdited collapse true chatMessageEdited: { action: 'chatMessageEdited'; data: {
...
body: string;
...
messageId: string; attachments: unknown[];
...
};
...
}- chatMessageRead - Оператору пришло сообщение, что клиент прочитал сообщение в чате
Блок кода language javascript title
...
chatMessageRead collapse true
...
chatMessageRead: { action: '
...
chatMessageRead'; data: {
...
messageId: string;
...
}; }- chatSessionDeleted - Есть кейсы, когда сессия после отправки определенного сообщения уходит на бота - и тогда пропадает у оператора
- chatSessionSwitchedFromBotToOperator - Сессия была переключена с бота на оператора
- sessionClosedByClient - Клиент закрыл сессию
- operatorBlocked - Оператора заблокировали на платформе — требуется выкинуть оператора из кабинета
- chatUserExists - Кто-то зашел в текущего оператора. Текущий сеанс оператора нужно закрыть
- typing - пользователь печатает сообщение в чате
- operatorLoggedOut - сделать оператора офлайн
- clientOnline - клиент стал онлайн
- clientOffline - клиент стал офлайн
...
| language | javascript |
|---|---|
| title | chatMessageRead |
| collapse | true |
...
| Блок кода | ||||||
|---|---|---|---|---|---|---|
| ||||||
chatSessionDeleted: {
action: 'chatSessionDeleted';
data: {
sessionId: string;
};
} |
...