How to preserve session data

The documentation is confusing here - https://all.docs.genesys.com/WID/Current/SDK/WebChatService-combined

specifically, why setSessionData does not set anything but rather retrieves something from Cookes. Same goes for getSessionData - it sets some data but does not return anything.
Also, I copied the example as is but I'm getting Client token is required error when I'm trying to open the web chat. What am I doing wrong? Thanks.

Hello,

As a matter of fact, the https://all.docs.genesys.com/WID/Current/SDK/WebChatService-combined page relates to the Genesys Engage platform.

Some of the Genesys Widgets modules/plugins (UI), like the WebChat module, can be used with the different Genesys platforms (Genesys Cloud, Genesys Engage, PureConnect).
The protocol, used underneath, will change (defined through WebChatService) - but the WebChat UI is common to all three platforms.
setSessionData and getSessionData and the WebChatService description, on the page you referenced, are specific to the Genesys Engage platform.

If you go on this page, you will see a "Genesys Cloud" tab at the top, and another tab for "Genesys Engage".
The configuration supported by WebChat and WebChatService with Genesys Cloud is defined in the following pages:
https://all.docs.genesys.com/WID/Current/GCAPI/WebChat
https://all.docs.genesys.com/WID/Current/GCAPI/WebChatService

You can also find some examples on the Developer Center: https://developer.mypurecloud.com/api/digital/webchat/widget-version2.html

Regards,

1 Like

Hi Jerome,
thank you for your reply.
The configuration that I'm using has webchat.transport.type set to pureengage-v3-rest.
Does this define what platform is being used?
So, I guess I'm using the wrong forum?

Hello,

Yes, this forum is related to Genesys Cloud platform (formerly known as PureCloud).

If you have questions on Genesys Engage on-premise, this would be the community forum here.
If you have questions on Genesys Engage Cloud, this would be the community forum here.

Regards,

I have asked someone about the geSessionData/setSessionData. I am also wondering if the functions are switched or just the parameters.
I'll update this post if ever I get an answer.

Thanks. This is much appreciated.

Could you confirm that you are trying to connect your WebChat Widgets to a Genesys Engage Cloud environment (formerly PureEngage Cloud)?
And did you contact Customer Care so they could create an x-api-key for your environment and for nexus chat (and I assume a chat endpoint)?

If yes, would you have a test page so I can try on my side to understand what your issue may be (you can send me the url via Private Message if it is public - or the html/js source of your page otherwise)?
I don't have access to a Genesys Engage Cloud environment, but I tried to initiate a chat and didn't see this Client Token is required error. So might come from Genesys Engage Cloud side. A test page would help to understand.

I think the description of the 2 functions in the WebChatService Options section are switched - but used correctly in the sample (although there is a "," missing there).
I mean in https://all.docs.genesys.com/WID/Current/SDK/WebChatService-combined#Options under the portion related to " Version 3 API".

From what I understand, getSessionData is to save the sessionData (the JWT Token) in cookies or in an external system (a DB or whatever you want - modifying the corresponding code).
getSessionData will be invoked after you have created a chat and when you have obtained a JWT token from Genesys Engage Cloud for that chat. You can then save this sessionData (in a cookie in the example).

setSessionData is to set the sessionData (the saved JWT Token of a previous async chat session) in the Widgets plugin (so it can "reopen" the existing async chat session).
When you open the Chat Form/when you start a chat, the setSessionData will be invoked to retrieve the saved JWT Token (from cookies, from external system) and will allow to set it in the Widgets Plugin.

Regards,

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