Legacy Dev Forum Posts

 View Only

Sign Up

Practical web messaging chat configurations?

  • 1.  Practical web messaging chat configurations?

    Posted 06-05-2025 18:36

    y.fukuda | 2022-10-21 08:24:52 UTC | #1

    hi!

    I am configuring a chat using the web messaging method. We would like to use the user context information obtained using conversationId to determine the start and end of the chat. I have tried the platform API and the web messaging method, what are the best practices?

    1]. Establish a [configureAuthenticatedSession after user authentication.

      • Unlike configureSession, will user context information like conversationId be included in Inbound and Outbound?

    [2]. Establish configureSessin, and if user context information such as conversationId is needed, use a combination of PlatformAPI.

    Should I implement [1] or [2]?

    thank you


    Angelo_Cicchitto | 2022-10-21 09:03:34 UTC | #2

    Hello - it sounds like you would want to expose some data from Genesys Cloud on your website. Can you please clarify the following?

    • What do you mean by user context information obtained using converstionId? Can you give an example?
    • What use-case are you trying to solve? How would you use that data within end-user's browser?

    y.fukuda | 2022-10-24 02:35:07 UTC | #4

    Thank you for your reply.

    What do you mean by user context information retrieved by using the ConverstionId? Can you give an example? What use case are you trying to solve? How will you use that data within the end user's browser?

    I will try to be more specific so that you can get the answer you want. I would like to know regarding Q1 and Q2 below.

    ===

    about Q1

    In conclusion, I want to use GET /api/v2/conversations/messages/{conversationId} to know if the agent is alerting, connected or disconnected by the agent.

    I would like to determine this by looking at the results of participants purpose=agent in the results of executing this API. I would like to see the details from the API Explore.

    { "purpose": "agent", "state": "connected" // "alerting" or "disconnected", }

    Note that conversationId cannot be obtained by the web messaging method (configureSession), so I intend to use the following ingenuity to obtain it.

    When sending a CustomerJoin with action=onMessage, pass the unique ID of the chat (chatSession) to channel.metadata.customAttributes, and then the whole conversation will be retrieved with GET /api/v2/conversations/messages and determine the conversationId by whether the resulting attributes.chatSession matches the chatSession sent.

    "entities": [ { "id": "<conversationId>", "participants": [ { "id": "*******", "purpose": "customer", "state": "connected", "attributes": { "chatSession": "d80468f9-0faf-4129-ac98-7b41ac13bd2c" },

    This is the implementation flow I'm thinking of right now when using a combination of web messaging (configureSession) and PlatformAPI.

    Q1: Is there a better way than this?

    ===

    about Q2

    I haven't tried it yet, but it seems that there is a way to use configureAuthenticatedSession with web messaging. I would like to know the following before trying this.

    Q2: What kind of Inbound/Outbound messages are returned? I would like to know the type. In particular, can I get information such as agent status (alerting, connected, disconnected) without using PlatformAPI, unlike configureSession?

    thank you.


    Angelo_Cicchitto | 2022-11-09 08:47:06 UTC | #5

    Hi @y.fukuda thanks for clarifying. Authenticated Web Messaging doesn't make any difference here, and we do not expose conversationId in the Guest Session. The type of events you're wanting exposed to the Guest Sessions are not available for now. We are working on a new feature to expose the disconnected event to the Guest client, this is currently in-progress, see here: https://genesyscloud.ideas.aha.io/ideas/DXWMM-I-26 In future we could consider exposing more events, to increase the level of awareness to End-User.


    y.fukuda | 2022-11-21 02:46:48 UTC | #6

    Thank you for your answer. I understand. I look forward to seeing it implemented. :grinningfacewithsmilingeyes:


    system | 2022-12-21 02:47:40 UTC | #7

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


    This post was migrated from the old Developer Forum.

    ref: 16818