Hi. I could successfuly implement a listener (in JS) for a specific webchat , using the API , and the suscription filter ('message','open',...).
As this is limited to the agent been logged (per token), now I was wondering if is there something like a "supervisor" notification that could be independent of the agent, and his/her the session. Maybe a role or API of the style.
¿Is there something like that or any other approach?
Via API :
(0) // Create chat
webChatApi
.postWebchatGuestConversations(createChatBody)
(1) GET https://api.mypurecloud.com/api/v2/webchat/guest/conversations/${chatId}/messages
(2) POST https://api.mypurecloud.com/api/v2/webchat/guest/conversations/{chatId}/members/{memberId}/messages
(3) LISTENER 'message' :
// Listen for messages
socket.addEventListener('message', function (event)
............
switch(message.metadata.type) {
case 'message': {
// Handle message from member
console.log('Mensaje:' + message.metadata.type);
}
case 'member-change': {
// Handle member state change
console.log('Cambio de Miembro:' + message.metadata.type);
...
}
case 'typing-indicator': {
// Typing....
console.log('Tipeando...');
...
}
default: ...
}