No conversation available for the given conversationId

Hi!

I am using Freshchat API token (https://personal-70177.freshchat.com/) for creating my custom channel integration. In general everything worked well, but now…

For my custom channel incoming messages:

  1. Create user: POST https://api.eu.freshchat.com/v2/users and get user ID – OK.
  2. Send message: POST https://api.eu.freshchat.com/v2/conversations and get conversation ID (85757e8d-a254-4a92-b209-ac010fbda347) – OK.

For my custom channel outgoing messages:

  1. Get conversation by ID: GET https://api.eu.freshchat.com/v2/conversations/85757e8d-a254-4a92-b209-ac010fbda347/ – OK – returned ID 85757e8d-a254-4a92-b209-ac010fbda347.
  2. Get conversation messages: GET https://api.eu.freshchat.com/v2/conversations/85757e8d-a254-4a92-b209-ac010fbda347/messages?items_per_page=50FAILED – No conversation available for the given conversationId :astonished:

It is important that this error only with some conversions. What is this error? Is this a bug or a feature?)
it is also interesting that I have a webhook configured and it sends me events with this conversation ID, but I can not get messages by this conversation ID.

Thank you!

Hi,

Currently, there is a delay in fetching the conversation messages since it comes from a read replica.
If you try fetching the same conversation later (after about 20 mins), you will not receive this error.

Regards,
Arun Rajkumar

1 Like

Thank you for reply, now I understand the reason. But this conversation still not available (more than 3 hours passed). How I can working with this now (get messages from conversation)? Only via webhooks?

Hi Vitali M,

To my knowledge, I think there is no endpoint to get the messages corresponding to the conversation.
Refer this docs for the available endpoints.

Please let me know if I’m wrong.

Hi,

Yes, it is not in the docs, also in this docs written that GET /conversations/{conversation_id} return the conversation object with messages, but this is not true.

And the only way now as I understand it is webhook.

The fetch conversation API fetches messages from a Read-replica DB.
It is possible that there is a lag in the replica DB and the conversation ID you are fetching is still not updated in it.

This is an issue that is being fixed.

2 Likes

The latest update is that the fix went out last week.

2 Likes