How to Get ConversationId from Outbound Open Messaging Webhook Typing Event

Hello,

I am using Open Messaging integration and when an agent writes something on a conversation, Genesys Cloud sends a Typing event to my webhook endpoint.
The sample request content of this Typing event is below.
It doesn't include the ConversationId and I need it to find from Genesys Cloud.
Can you please tell me by which fields of this request can I make a query through an API to find the ConversationId?

{
"id": "f0e01cc7f0c3faa53066b46829db6c41",
"channel": {
"id": "6a743fff-9c8a-4649-8af4-1162ee326bbg",
"platform": "Open",
"type": "Private",
"to": {
"id": "1234567890"
},
"from": {
"nickname": "OpenMessagingIntegration",
"id": "6a743fff-9c8a-4649-8af4-1162ee326bbg",
"idType": "Opaque"
},
"time": "2023-11-02T08:00:22.881Z",
"messageId": "f0e01cc7f0c3faa53066b46829db6c41"
},
"type": "Event",
"events": [{
"eventType": "Typing",
"typing": {
"type": "On",
"duration": 5000
}
}
],
"direction": "Outbound"
}

Regards

Hi @ugur.bayramoglu,
Please have a look at this page for some key facts about typing events https://developer.genesys.cloud/commdigital/digital/openmessaging/inboundEventMessages (toward the bottom). Typing events are not persisted messages, so you can't use them in the exact same ways you use "real" messages that are persisted. Here is a possible workaround I could think of for your situation.

  1. Originally your open messaging service is inbounding the message from the end user to GC, right? So you could use that inbound "real" messageId to know the Conversation it goes on. You could use https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-conversations-messages--conversationId--messages--messageId- for that
  2. You know that "real" message goes with that GC Conversation. So you know any typing events you receive on your open integration, until the GC disconnects the conversation, will use that same conversationId. If GC side (agent) disconnects the conversation, you wouldn't receive any more typing events anyway.

Hope this helps.

Hi @Greg_Boston, thanks for your reply.
I have developed a middleware application between GC and the end user.
This middleware application may be scaled horizontally to multiple nodes according to the resources usage.
I can store every ConversationId and EndUserId match in the middleware and find the conversationId from my cached data through the EndUserId which is indicated in the Typing event request.
However since my middleware app my be scaled horizontally I will need an external caching system to store this data and it will become extra complex for just this need.
GC is already tracing every conversation with a unique Id which is the conversationId. It would be nice and I was expecting it to inform the related conversationId in the outbound typing event webhook.
At worst I will try to find the conversationId from any key of the outbound typing event with one extra step but even that seems not possible with the existing GC API's.

Sorry, in my above example i pasted the wrong link in point #1. It should have been https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-conversations-messages--messageId--details to get the conversationId associated with a "real" messageId.

GC is already tracing every conversation with a unique Id which is the conversationId. It would be nice and I was expecting it to inform the related conversationId in the outbound typing event webhook.

I understand for your use case that you may have some need for this. I'm not sure i would agree you should have expected GC to inform you of the conversationId on typing events, because we don't that on other messages today either. Instead it sounds like you want some new functionality here, you can explain your use case and request features using https://genesyscloud.ideas.aha.io/

As you have said, the API link you gave is to get the conversationId from real messageId.
Since the webhook notification message of typing event is not a real message, I can not use the link you gave to find the conversationId from the messageId field of outbound typing event request.
I already tried it, and the API returns "No Message could be found with an id of f0e01cc7f0c3faa53066b46829db6c41" as expected.
So I come back to my first question again, how can I reach to the conversationId from the outbound open messaging webhook typing event?
Thanks

I don't have another suggestion, other than my reply before about you keeping track of the conversationId yourself in your middleware.
I am curious though, why do you need a conversationId for a typing event specifically? Typically external end users (that I assume your middleware is connecting to) don't care or need to know about GC conversationIds, and especially so for a typing event.

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