Conversation ID expiration

Hi,

Is there a certain expiration time for a chat's conversation id or is it alive only till chat is connected?. I have looked through documentations and couldn't find anything related to this. If their is an expiration time, is there any API to query that?

Edit: Maybe what I'm looking for is to query the chat's state (active/inactive) via an API, I found this should give the state of the conversation but I'm getting for each participant not for the whole chat itself. Doc referenced - https://developer.genesys.cloud/routing/conversations/conversations-apis#get-api-v2-conversations--conversationId-

API - /api/v2/conversations/{conversationId}
Result -
{
"id": "4709b21d-bc22-418a-8c6d-4ededb31bd39",
"startTime": "2022-07-18T11:59:59.734Z",
"endTime": "2022-07-18T12:08:27.440Z",
"participants": [
{
"id": "bc41b6bd-f304-4ded-ba11-1ae7838e658c",
"startTime": "2022-07-18T11:59:59.734Z",
"endTime": "2022-07-18T12:08:27.437Z",
"connectedTime": "2022-07-18T11:59:59.734Z",
"name": "Sophia Griffin",
"purpose": "customer",
"wrapupRequired": false,
"attributes": {
"context.firstName": "Sophia",
"context._genesys_OS": "Windows",
"context.lastName": "Griffin"
},
"calls": [],
"callbacks": [],
"chats": [
{
"state": "disconnected",
"id": "1279b232-5b65-48e8-9da2-a44b0af20f0f",
"segments": [
{
"startTime": "2022-07-18T11:59:59.734Z",
"endTime": "2022-07-18T12:08:27.437Z",
"type": "Interact",
"howEnded": "Disconnect",
"disconnectType": "client"
}
],
"held": false,
"direction": "inbound",
"disconnectType": "client",
"connectedTime": "2022-07-18T11:59:59.742Z",
"disconnectedTime": "2022-07-18T12:08:27.437Z",
"provider": "PureCloud Webchat v2",
"afterCallWork": {},
"afterCallWorkRequired": false,
"initialState": "connected"
}
],
"cobrowsesessions": [],
"emails": [],
"messages": [],
"screenshares": [],
"socialExpressions": [],
"videos": []
},
{
"id": "79055ba6-5153-4f02-9013-c123c791035a",
"startTime": "2022-07-18T11:59:59.735Z",
"endTime": "2022-07-18T12:08:27.440Z",
"connectedTime": "2022-07-18T11:59:59.735Z",
"purpose": "workflow",
"wrapupRequired": false,
"attributes": {
"context.Flow Name": "NON PROD - CI_Chat_SM"
},
"calls": [],
"callbacks": [],
"chats": [
{
"state": "disconnected",
"id": "8d607298-aaaf-4580-a5b6-2339e4edca34",
"segments": [
{
"startTime": "2022-07-18T11:59:59.735Z",
"endTime": "2022-07-18T12:08:27.440Z",
"type": "Interact",
"howEnded": "Disconnect",
"disconnectType": "peer"
}
],
"held": false,
"direction": "inbound",
"disconnectType": "peer",
"connectedTime": "2022-07-18T11:59:59.768Z",
"disconnectedTime": "2022-07-18T12:08:27.440Z",
"provider": "PureCloud Webchat v2",
"afterCallWork": {},
"afterCallWorkRequired": false,
"initialState": "connected"
}
],
"cobrowsesessions": [],
"emails": [],
"messages": [],
"screenshares": [],
"socialExpressions": [],
"videos": []
}
],
"recordingState": "NONE",
"divisions": [
{
"division": {
"id": "c5f2133b-1d5e-4a47-874e-2fa088d0258f",
"selfUri": "/api/v2/authorization/divisions/c5f2133b-1d5e-4a47-874e-2fa088d0258f"
},
"entities": [
{
"id": "25d84675-d5ac-4198-82bc-b9c6e61a3891",
"selfUri": "/api/v2/flows/25d84675-d5ac-4198-82bc-b9c6e61a3891"
}
]
}
],
"selfUri": "/api/v2/conversations/4709b21d-bc22-418a-8c6d-4ededb31bd39"
}

Thanks,
Sridevi

Hello,

A chat conversation/session will be terminated in 2 cases.

  1. When/If the websocket connection is dropped (guest to Genesys Cloud) or if Websocket Heartbeats are missed, there is only a couple of minutes to reconnect. Otherwise the chat conversation will be ended (on Genesys Cloud).
    See explanations in the Reconnecting the guest

  2. 15 minutes inactivity while connected to a Contact Center Agent (guest not sending messages)
    See the notes in this section
    No activity auto-disconnect
    While connected to an agent, if the guest does not send any messages for 15 minutes, the guest will be automatically disconnected. This timeout only applies while connected to an agent; activity is not required from the guest while waiting in queue.

I off course didn't mention the case where the guest requests to terminate the chat, or where Architect flow (Disconnect block) or the Contact Center Agent end the conversation.

Regarding checking the chat's state, I don't know if your idea is to do that from Genesys Widgets v2 (the built-in guest UI), from Guest Chat API level, or from a backend using Platform API.
With Platform API, knowing the conversationId, you can use the API endpoint you have included in your post above.
If the response has an "endTime" attribute (as your logs above), it means the chat is terminated.
A Web Chat v2 conversation cannot be reopened.
While the chat is active, endTime attribute is not present.

Regards,

Thanks, we want to know the chat's state from Guest Chat APIs point of view. Will this API work for that?

I am not tally sure I understand why you need this - a specific check.

I mean that the events that you receive over the websocket will tell you when the chat is ended.
Websocket events

If you are looking for an API query, you could use GET /api/v2/webchat/guest/conversations/{conversationId}/members
This will either return a list of participants/members. If all show a "state": "DISCONNECTED", it means chat is ended.
Or after a while (not sure how long), the bearer token will probably expire and you will get an HTTP error.

Regards,

1 Like

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