Is it possible to get previous journey

When the user connected to the live agent we need to capture the previous journey and save it in the database

Hi @Sai_Sandeep,
Below is the cURL reuest. Please add sender, bot id API key

curl --location --request GET 'https://cloud.yellow.ai/api/agents/data/messages?bot=<botid>&uid=<sender>' \
--header 'x-api-key: <key>'

From here you can get the chat transcript,
Use the latest slug name to filter last intent’s conversation.

1 Like

Hi, While @Subhrajit_Gupta suggested a way for the solution you want to implement.

If I’m not wrong the core of the problem is that you/associated business needs a way to analyse ‘where’ and ‘why’ agent deflection is happening most.
Is that correct @Sai_Sandeep ?

I would like it if you can expand here on what analysis or insights you feel are missing.

Yes @Aakanksha_Jain Client needs to analyse from which journey users are connecting to the agent. In this bot, we given connect to agent option for all the journeys

@Subhrajit_Gupta From the API I am not able to identify the previous journey. When we hit the API we received the below response

{
    "success": true,
    "message": "Success",
    "data": [
        {
            "_id": "63999ceefbc98a0001f68475",
            "shouldTranslateMessage": false,
            "created": "2022-12-14T09:52:46.746Z",
            "updated": "2022-12-14T09:52:46.746Z",
            "botId": "x1655106487306",
            "uid": "3227156631928542555708574851",
            "message": "{\"message\":\"We are not able to connect to a live agent at this time, please send your query to hello@zolve.com\",\"filePrompt\":false}",
            "messageType": "BOT",
            "sessionId": "639999e5e73c490008125d08",
            "slug": "chat-with-agent:response",
            "feedback": "",
            "source": "yellowmessenger",
            "questionId": "63999ced2d256700091b9d55",
            "medium": "message",
            "conversationId": "3227156631928542555708574851",
            "ticketId": "100109",
            "messageTags": [],
            "nodeType": "text",
            "traceId": "3227156631928542555708574851_py0s0LCTZbiWJtixTAKQx",
            "__v": 0,
            "messageStatus": {
                "status": "delivered",
                "timestamp": 1671011566,
                "systemStatus": "user_received"
            },
            "channelMsgId": "63999ceefbc98a0001f68475",
            "createdAt": "2022-12-14T09:52:46.906Z",
            "updatedAt": "2022-12-14T09:52:46.906Z"
        },
        {
            "_id": "63999ceefbc98a000138365d",
            "shouldTranslateMessage": false,
            "created": "2022-12-14T09:52:46.547Z",
            "updated": "2022-12-14T09:52:46.547Z",
            "botId": "x1655106487306",
            "uid": "3227156631928542555708574851",
            "message": "{\"message\":\"Please give me a moment to connect you to an agent.\\n\\n\\n\\n\\n\",\"filePrompt\":false}",
            "messageType": "BOT",
            "sessionId": "639999e5e73c490008125d08",
            "slug": "chat-with-agent:e2271f6533a11143",
            "feedback": "",
            "source": "yellowmessenger",
            "questionId": "63999ced2d256700091b9d55",
            "medium": "message",
            "conversationId": "3227156631928542555708574851",
            "messageTags": [],
            "nodeType": "text",
            "traceId": "3227156631928542555708574851_py0s0LCTZbiWJtixTAKQx",
            "__v": 0,
            "messageStatus": {
                "status": "delivered",
                "timestamp": 1671011566,
                "systemStatus": "user_received"
            },
            "channelMsgId": "63999ceefbc98a000138365d",
            "createdAt": "2022-12-14T09:52:46.668Z",
            "updatedAt": "2022-12-14T09:52:46.668Z"
        },
        {
            "_id": "63999ced2d256700091b9d55",
            "shouldTranslateMessage": false,
            "created": "2022-12-14T09:52:45.688Z",
            "updated": "2022-12-14T09:52:46.725Z",
            "botId": "x1655106487306",
            "uid": "3227156631928542555708574851",
            "message": "{\"text\":\"Yes\",\"title\":\"Yes\"}",
            "messageType": "USER",
            "sessionId": "639999e5e73c490008125d08",
            "slug": "update-personal-details_nxclfm:1ea6b2f7f855d6c3",
            "feedback": "",
            "source": "yellowmessenger",
            "medium": "message",
            "messageAdditionalData": {
                "subSource": "pwa",
                "debug": true,
                "interactionType": "quick-replies",
                "richMessage": {
                    "text": "Yes",
                    "title": "Yes"
                },
                "medium": "message"
            },
            "messageTags": [
                "HUMAN_TAKEOVER"
            ],
            "traceId": "3227156631928542555708574851_py0s0LCTZbiWJtixTAKQx",
            "__v": 0,
            "data": {},
            "messageStatus": {
                "status": "pending",
                "timestamp": 1671011565,
                "systemStatus": "controller_receive",
                "metadata": {
                    "note": "The message has reached to controller and its getting processed"
                }
            },
            "channelMsgId": "63999ced2d256700091b9d55",
            "createdAt": "2022-12-14T09:52:46.778Z",
            "updatedAt": "2022-12-14T09:52:46.778Z"
        },
        {
            "_id": "63999cea2baea30001200872",
            "shouldTranslateMessage": false,
            "created": "2022-12-14T09:52:42.621Z",
            "updated": "2022-12-14T09:52:42.621Z",
            "botId": "x1655106487306",
            "uid": "3227156631928542555708574851",
            "message": "{\"quickReplies\":{\"title\":\"\",\"options\":[{\"text\":\"\",\"title\":\"Yes\",\"id\":\"quick_02d3894197654089\"},{\"text\":\"\",\"title\":\"No\",\"id\":\"quick_6c5818971858f3e8\"}]},\"hideInput\":false}",
            "messageType": "BOT",
            "sessionId": "639999e5e73c490008125d08",
            "slug": "update-personal-details_nxclfm:1ea6b2f7f855d6c3",
            "feedback": "",
            "source": "yellowmessenger",
            "questionId": "63999cea4dfc3d00081ef17c",
            "medium": "message",
            "conversationId": "3227156631928542555708574851",
            "messageTags": [],
            "nodeType": "quickReplies",
            "traceId": "3227156631928542555708574851_G4w8TJNAKcCpyFltr8rXi",
            "__v": 0,
            "messageStatus": {
                "status": "delivered",
                "timestamp": 1671011562,
                "systemStatus": "user_received"
            },
            "channelMsgId": "63999cea2baea30001200872",
            "createdAt": "2022-12-14T09:52:42.750Z",
            "updatedAt": "2022-12-14T09:52:42.750Z"
        }
    ]
}

Hi @Sai_Sandeep ,
Please check the slug property. If you are looking for the latest intent, the unique slug name will be at the top.
With messageType

"messageType": "USER", or BOT

you can filter out if its a user message or BOT response.

@Sanskrity @Anmol FYI

Thanks @Aakanksha_Jain .

@Sanskrity Let’s add this to the roadmap. This is a valid use case.