Notifications for every webchat using the API

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: ...
                }

No, chat metadata events are scoped to the conversation and JWT. You can request the new topic and share your use case at https://purecloud.ideas.aha.io/ideas.

If you have a server-side backend that can securely handle client credentials, you may be able to use a single notification channel to subscribe to the metadata events for multiple conversations. That won't cut down on the number of topics you'll need to subscribe to, but at least you wouldn't have an open websocket for each conversation that way.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.