Freshchat API conversations

Hi!

I’m building a backend integration with Freshchat API and one of the problems I’m facing is related to /conversations/{conversationID} endpoint. My goal is to gather conversations data that my clients have created through Freshchat.

The plan was to:

  1. create a "Chat-Transcript" report
  2. extract conversationID from the report
  3. make an API call to GET /conversations/{conversationID}
  4. collect data about specific conversation

Problem:

Right now, when I extract conversationID from the report and make request to GET /conversations/{conversationID}, I receive much less data than expected.

My request: https://klausapp-490452347475593554-6ce6fcfe2249c5c16632586.freshchat.com/v2/conversations/2437ebee-895f-423b-9470-f22e4eb90a44

Headers:

  • Accept: application/json
  • Authorization: Bearer + API KEY

returns (json below):

{
    "conversation_id": "2437ebee-895f-423b-9470-f22e4eb90a44",
    "app_id": "e170fe75-e4e0-462b-a78d-e09dbba2e5c2",
    "status": "new",
    "channel_id": "a72858a9-438e-4763-a895-48e608ba016f",
    "skill_id": 0
}

But when I look at Freshchat Swagger documentation I’d expect to receive something like that (json below, copied from Swagger success request):

{
  "conversation_id": "c2937604-0a08-43c2-a09c-e77f5f565a0e",
  "app_id": "9d83ebc5-e036-4b48-b655-b0d79584b2c5",
  "messages": [
    {
      "message_parts": [
        {
          "text": {
            "content": "string"
          },
          "image": {
            "url": "www.example.com"
          },
          "url_button": {
            "url": "string",
            "label": "string",
            "target": "_self"
          },
          "quick_reply_button": {
            "custom_reply_text": "string",
            "label": "string",
            "payload": "string"
          },
          "collection": {
            "sub_parts": [
              "string"
            ]
          },
          "template_content": {
            "type": "quick_reply_dropdown",
            "sections": [
              {
                "name": "title",
                "parts": [
                  "string"
                ]
              }
            ]
          },
          "callback": {
            "payload": "{\"id\":\"483b0c7a-583e-4d5f-a486-9028cdc39e24\", \"vote\":\"1\"}",
            "label": "👍 upvote"
          },
          "reference": {
            "reference_id": "6c03caf2-a37f-45a2-a9a3-6e03aa7b85f9",
            "label": "string"
          }
        }
      ],
      "reply_parts": [
        {
          "text": {
            "content": "string"
          },
          "image": {
            "url": "www.example.com"
          },
          "url_button": {
            "url": "string",
            "label": "string",
            "target": "_self"
          },
          "quick_reply_button": {
            "custom_reply_text": "string",
            "label": "string",
            "payload": "string"
          },
          "collection": {
            "sub_parts": [
              "string"
            ]
          },
          "template_content": {
            "type": "quick_reply_dropdown",
            "sections": [
              {
                "name": "title",
                "parts": [
                  "string"
                ]
              }
            ]
          },
          "callback": {
            "payload": "{\"id\":\"483b0c7a-583e-4d5f-a486-9028cdc39e24\", \"vote\":\"1\"}",
            "label": "👍 upvote"
          },
          "reference": {
            "reference_id": "6c03caf2-a37f-45a2-a9a3-6e03aa7b85f9",
            "label": "string"
          }
        }
      ],
      "app_id": "d01f83a4-6af0-4a05-8906-47284db2e1a8",
      "actor_id": "9d304e8a-31fd-4e4a-85e8-b62edb95d53f",
      "id": "6c03caf2-a37f-45a2-a9a3-6e03aa7b85f5",
      "channel_id": "1b99afe4-7b3d-4f9e-b284-d7778b249f6e",
      "conversation_id": "da8de71b-78c8-4256-8923-0de858ff6a80",
      "message_type": "normal",
      "actor_type": "agent",
      "created_time": "2017-11-16T11:34:04.431Z",
      "meta_data": {
        "isResolved": "true"
      },
      "in_reply_to": {
        "message_id": "6c03caf2-a37f-45a2-a9a3-6e03aa7b85f5"
      },
      "message_source": "WEB"
    }
  ],
  "status": "new",
  "channel_id": "2681d294-3460-4f32-b5fb-828958995b5c",
  "agents": [
    {
      "id": "2681d294-3460-4f32-b5fb-828958995b5c",
      "email": "govind.patel@freshworks.com",
      "avatar": {
        "url": "https://web.freshchat.com/img/johndoe.png"
      },
      "phone": "123456789",
      "biography": "I'm your friendly neighbourhood support guy!",
      "role_id": "string",
      "skill_id": "d01faba8-6655-4cce-88fa-a596cc75ece5",
      "is_deactivated": false,
      "freshid_uuid": "d01faba8-6655-4cce-88fa-a596cc75ece5",
      "locale": "en-us",
      "timezone": "Asia/Kolkata",
      "availability_status": "AVAILABLE",
      "agent_status": {
        "id": "8e755ebf-6921-465d-b713-985a8ad13c04",
        "name": "Tea break"
      },
      "routing_type": "OCR",
      "get_ocr_available": 0,
      "first_name": "Govind",
      "last_name": "Patel",
      "social_profiles": [
        {
          "type": "facebook",
          "id": "govind.patel"
        }
      ],
      "groups": "[string1, string2]"
    }
  ],
"users": [
    {
      "id": "2681d294-3460-4f32-b5fb-828958995b5c",
      "email": "govind.patel@freshworks.com",
      "avatar": {
        "url": "https://web.freshchat.com/img/johndoe.png"
      },
      "phone": "123456789",
      "properties": [
        {
          "name": "orderId",
          "value": "#1242"
        }
      ],
      "first_name": "Govind",
      "last_name": "Patel",
      "social_profiles": [
        {
          "type": "facebook",
          "id": "govind.patel"
        }
      ],
      "reference_id": "9d83ebc5-e036-4b48-b655-b0d79584b2c6",
      "created_time": "2018-08-16T11:34:04.431Z"
    }
  ],
  "assigned_agent_id": "c2937604-0a08-43c2-a09c-e77f5f565a0e",
  "assigned_group_id": "c2937604-0a08-43c2-a09c-e77f5f565a0e"
}

So basically I’m missing “messages”, “agents” and “users” array. In my case all those arrays should include data, but even if they wouldn’t, I’d expect to receive those fields as empty arrays or nulls.

What’s causing that?

All the best
Raido

Hi @Raido_Roben ,

Thanks for your patience, really appreciate it.

The documentation for the API is not the latest one. The latest API updates with relevant documents shall be rolled out soon. Apologies for the inconvenience caused.

Meanwhile, for the expected response kindly use GET conversations/{conversation_id}/messages method which should return the data that you are looking for.

Regards,
Thakur