Need past conversation happening on freshworks partners in freshchat

Hi,
I want the past conversations that are happening on Engagely (A conversational AI platform) in freshchat while the user is connecting to the livechat (freshchat). Please help me in which API do I need to pass the past conversation so that it can reflect on freshchat or is there any other way to do that?

Hi Gaurav,

Will the user_alias remain the same irrespective of the number of conversations? If yes, then you can below API to get the conversation aliases.

curl "https://api.freshchat.com/v2/users/<freshchat_user_alias>/conversations" \
     -H 'Authorization: Bearer <PUBLIC API KEY>'

The response of the API call will be array as shown below.

{
  "conversations": [
    {
      "id": "conversation_alias1"
    },
    {
      "id": "conversation_alias2"
    }
  ]
}

If you do not have the user_alias at the ready you can also use the below API to query using the external_id or reference_id to get the user_alias

curl --location --request GET 'https://api.freshchat.com/v2/users?reference_id=paul@pogba.com' \
--header 'Authorization: Bearer <PUBLIC API KEY>'

Hope this helps.

3 Likes

Hi Arjun,

Thanks for your solution. As I can see the given API is for retrieving the past conversation of freshchat. But In my case I want to send the array of conversations (from Engagely our conversational platform) and that should reflect in freshchat while connecting to freshchat as a livechat agent. You please help me for sending those conversations to freshchat.

1 Like

@gauravshahu Sorry for my misunderstanding.

You can do that too while using the message create API. The messages can be set in the message_parts array as shown below. I believe Engagely is a bot service. So when you handover the chat to Freshchat, the transcript can be constructed in a similar manner to the payload below.

{
  "message_type": "normal",
  "actor_type": "agent",
  "actor_id": "agent alias",
  "message_parts": [
    {
      "text": {
        "content": "<b><i>User:</b></i> Hi"
      }
    },
    {
      "text": {
        "content": "<b>Bot:<b> Hi, this Presely!! <br/> How can I help you?"
      }
    }
  ]
}

Let me know if this works.

3 Likes