Hi Forum,
my question is regarding the Chat Widget v2.
I would like to know if it's possible, maybe using conversationId and memberId or even the websocket URL, restore on the Widget a chat that was created before using the API POST /api/v2/webchat/guest/conversations.
I don't understand your question, if you are asking about the Guest Chat API, or the built-in Widgets v2 (user interface).
Regarding Widgets v2 (built-in UI):
The WebChat is natively/automatically restored by the WebChat widgets based on information (conversationId, websocket url, ..) stored in browser cookies, when the chat session was initiated from the WebChat Widget.
The feature is meant to manage cases like a customer refreshing the current page (where widgets scripts and configuration are set), a customer switching to a different page (where widgets scripts and configuration are set).
When the Widget is loaded and initialized, it will check values in the browser cookies and attempt to restore the chat session automatically.
But note that when the WebSocket is disconnected, you only have a couple of minutes (around 2 max) to restore the chat session, before the webchat conversation is automatically terminated (at cloud/server level).
If your question is about a chat session which would be started via Guest Chat API (I mean API directly), and that you are trying to restore via the built-in Widgets v2 (UI), the answer is no - it's not possible.
If your questions is about a chat session which would be started via Guest Chat API, and that you are trying to restore via API as well. Yes, you can reuse conversationId and websocket url - but you only have a couple of minutes max to re-establish/reconnect the websocket before the conversation is automatically terminated at server level.
If your idea is to implement a sort of asynchronous chat (with Widgets v2 or with API), then no. You only have a couple of minutes after the disconnect of the websocket before the conversation times out (is ended at server level).
Asynchronous chat will be provided via a new protocol - which is in development - named Web Messaging.
Hi Jerome,
yes, I would like to do exactly what you wrote here:
in othen words, start a chat with the API and then (before the timeout) restore in an instance of the Widget. I had already thought it was tricky, so doesn't matter.
In addition, I have another question: using the API you can have the Authenticated Guest feature; there is something similar with the Widget (version 2)?
Thank again!
P.S. Thank for the explanation how the Widget works, for sure is usefull for have a better understanding of the software.
No, unfortunately, the Widget v2 built-in UI (for WebChat) does not support Authenticated chat.
There is no way I found to "trick" the system using Widgets commands and events.
I mean I could trigger a request upfront (to a webservice/lambda/Google Cloud function that would implement the API endpoint to request an authenticated chat token/jwt).
But this jwt must be provided in the Create Chat request (sent from the Widgets) via an additional memberAuthToken attribute.
And there is no way to alter the body of that request using Widgets WebChat/WebChatService command and events.
Along with the new web messaging protocol, Product Management/Engineering is creating a new version of the widget (Messenger). And I read somewhere that authenticated web messaging would be planned later on as part of web messaging and Messenger (roadmap).