How to send/receive chat?

Good morning,
I'm sure there is a page buried somewhere that I'm just missing,, so hopefully this will be an easy one (lol). We've been working on getting chat set up in our app, and we're off to a good start:

  • We've set up a chat widget and confirmed that it is sending messages correctly (I can send myself a test message and see it in Genesys Cloud).
  • In my code, I've set up a notification for "v2.users." + myUserID + ".conversations.chats", and that seems to work without error.

But the only notifications I'm getting are "WebSocket heart beat". When I send myself a test message, there's nothing. I've fished around for info, but when I type "chat" in the search all I get is about this (seemingly unrelated) tutorial on how to do translation using some external translation service on AWS or something. That's cool and all, and at some point we may have to buy that other service... but for now foreign language translation is not relevant. Of course I've hit the plain old web, searching with DuckDuckGo, and I've even asked an AI... but there are still so many outdated pages from pervious versions of the API out there that idk what's still true and what's not. To add another layer of confusion, I've seen disparate slanguage used to describe this API - chat, web chat, chatv1, chat v2, web messaging, open messaging, OMNI chat, kitchen sink... okay, maybe not that last one. :laughing: Then there's what I'm guessing is embedded framework, with functions like "getChat" that don't sound like something from Genesys, and... yeah, I don't even know what search keywords to use anymore. At this point all I really know (or at least think I know) is it's not "ChatApi" (that's just for programmatically getting/setting chat-related settings, apparently) and it's not "WebChatApi" (I think I read somewhere that that was deprecated or... oh dog gone it idk :laughing: ). I feel like a blindfolded kid whacking away at a piñata, just swinging at anything that sounds like it moves. :laughing:

Is there a tutorial somewhere on the current chat-adjacent API, whatever the heck it may be called in 2024? I'm sure there is and I'm just not seeing it. Thanks in advance. :smile:

There are a whole lot of things named "chat" or "messaging", none of them related. You'll have to identify which thing you're using to get an answer.

This tells me you're likely using web chat v2 or web messaging. Can you drop a link to a doc page for what you implemented or a screenshot of the widget you're using if you're not sure where you got the code from?

Well the page is on a server that's not public-facing, and I wasn't the one who set up the widget, so idk where the docs were for it. But here is a screenshot of the widget, if that helps.
chat widget

That's messenger, the widget for web messaging. The docs in this section apply to that: https://developer.genesys.cloud/commdigital/digital/webmessaging/.

oh wow, looks like this one has a whole sloo of completely different APIs and SDKs, neither Platform nor WebRTC... no wonder I couldn't find it! :laughing: So I guess now that I'm at least In the right neighborhood, I'll just have to read through all the pages in this area to see if I can figure out what to do next. Thank you for pointing me in the right direction.

That's correct. The web messaging feature doesn't make use of the standard platform's interfaces (Platform API and WebSocket notifications); it has its own bespoke interfaces.

Interesting... I've just opened like a dozen new browser tabs, and the more I look into it, the more questions it raises... I just deleted a really long paragraph filled with questions. :laughing: But I guess I'll just have to take it page by page and see if I can make sense of it all. It definitely seems less tutorial-like, more encyclopedia-style reference material for people who already know what they're doing, but now that I at least know the correct name for the thing I can begin digging for videos and try different questions with the AI and all that. Like I said, thanks for pointing me in the right direction.

Hi there.
Not meaning to be a jerk, but would you mind posting that in a separate thread? It sounds like a widget setup issue (and I didn't set up our widget, so unfortunately I'm not much help, sorry). That's unrelated to my issue. For me, the widget sends stuff to Genesys... but the question is how to receive and send responses from my app (completely unrelated to your problem). I'm still decoding the paragraphs of assumptions in the docs I'm pouring over, cuz it's definitely not a step-by-step process so much as a memorize-it-all-and-pray-it-clicks-one-day type deal... like for me, I expect I'll have to get on a meeting with the co-worker who built the chat widget to see if he can decipher what it means by "deployments" and junk like that... these instructions were clearly designed for people who have already cracked the "which script tag do I load to get the new SDK" type nooby questions :laughing: II expect to be posting more questions here related to my stuff, so I would prefer to avoid confusion by introducing a second problem, if that's okay.

Sure, I'm happy to post in a separate thread.

1 Like

The user types their messages into the widget and sees incoming messages in the widget. This is base functionality; you don't have to build that. There are limited options to interface with the messenger though: https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/SDKCommandsEvents/messagingServicePlugin.

If you don't want to use the widget and want to build your own UI to send and display messages, then you should use the web messaging guest api https://developer.genesys.cloud/commdigital/digital/webmessaging/websocketapi.

Hi Tim. I've moved my post - getting the Webchat widget properly connected to my client's Genesys ORG so that an agent will see the message in queue - to this location: Webchat Widget V2 Not Delivering Chat Request to Genesys Cloud Queue per the original poster's request. I'm just trying to get the "out of the box" webchat functionality working and not having any luck.
Thanks!

I wasn't replying to your removed post. I was replying to LighthouseMike's post in this thread.

Ohhhh... so it's not really an API so much as some kind of plug-in-like, "widget-to-widget", pre-built chat system. That's not what we had in mind, so I will look into the "Guest" API. btw, as I was digging into the docs, I saw what looked like a whole mess of instructions on setting up another OAuth run (getting codes, trading codes for tokens and so on)... who is Guest (and will logged-in users need to authenticate with them as well as with Genesys)? Or maybe Guest is not a company or API, but a user role or something...

It sounds like you're referring to authenticated web messaging. That's an optional feature and not one you should implement unless you have a specific use case for it.

The "guest", in any web messaging context, refers to the end-user that is attempting to communicate with an agent.

1 Like

Gotcha. I thought it might be something like that. Yeah, we're trying to create something like the Genesys Cloud interface has, where chats come in and users can respond to them, there might be multiple chats, chat transfers, etc... looking at the page for the guest API, it's all about starting things from the customer side of things, creating a session and all that... but how do users know that a session has started? So like okay, let's say I get the config info from our chat widget (which looks like it has to be passed to our app, which probably means one more DB table and all that lol). Let's say I have the info set up - even if I'm just using the "receiver widget" (if there is one)... will I get a pendingSession event? Wait, that can't be, cuz that's a WebRTC SDK thing... will I need to set up a notification? No wait, that's a Platform SDK thing. Apologies for the "thinking out loud" here... how will users of my app become aware of the fact that a message has come their way? Will the receiver widget play a sound and pop up or something?

EDIT: PS: Thank you very much for your time. You've answered all my crazy questions today lol.

Is your custom app that you're building something for Genesys Cloud agents to use? Or is it something your end-customers, the "guest", will use? Both roles will obviously be involved in conversations, but which side is your custom app for?

This is important because you cannot customize or rebuild the agent side of web messaging. It's still a conversation and you get the media type agnostic behavior from all the normal Platform API endpoints (e.g. pickup, transfer, disconnect), but you have no way to interact with the web messaging media (e.g. send/receive messages). That implementation remains private and you must use one of the Genesys-provided UIs to handle web messaging media on the agent side.

In contrast, the guest API provides the full functionality for the guest side of the conversation. You can build your own guest interfaces from the ground up without using anything but the WebSocket-based guest API (and a solitary Platform API REST endpoint for message history...).

I see; it sounds like we have the wrong chat API. Yes, this is for users, people handling calls. The chat widget for "guests" is just a means to an end, a way to test our code. So is what we're looking for called something else? (Chat, Web Chat, etc.?). I'm not talking about the "guest" side of things at all.

I put out a query to the web messaging team just to be sure a new feature hadn't snuck out, but the good news (for you) is that one did! There actually are Platform API endpoints for the agent side now. There's no documentation for how to use them other than API Explorer, but I've asked that they be created. I would suggest also submitting an idea on https://genesyscloud.ideas.aha.io/ to request that the agent web messaging APIs be documented. Customer requests get a lot more priority than internal requests.

So here's the information I got. I don't have any guidance to share on exactly how to use them though. You'll have to do a little trial and error. If you get stuck on something, post what you can't figure out or what error you're getting and I can ask someone from the web messaging team to join the conversation.

1 Like

Okay, I knew I wasn't going crazy :rofl: But seriously though...

  • Thank you for the links! :smiley:
  • Yes, I will definitely recommend documentation for these awesome new features you guys are creating. I didn't know you had an ideas page like that, but IMO that is a really good idea that totally deserves a customer request (and yeah I get what u mean about customer requests vs. internal requests too, lol ).
  • And again, thank you very much for taking the time to walk through this with me. I get you probably get a zillion "I can't get ___ working" type posts to deal with, so I really appreciate that you were able to bear with me and help figure this all out.
1 Like

Hey, one last question: For the POST function, how do I get a "communicationId"? All the docs say for that parameter is "communicationId" (no further explanation). When I use the GET endpoint to list chats, I can get a "conversationId", but that is just one of two parameters. Not the first time the docs have gotten all mysterious on me, but it would be nice not to spend all day hackn'nguessing like I did the last hour of last nite. :laughing:

And speaking of docs, I tried to "submit an idea" on that other site, but it didn't like my login... unrelated to my main question, just an FYI. But I did try.