Hi, we are developing an application for your market place using Freshchat.
In freshchat if a user enables threading and the conversation gets expired. If we try to check the conversation info using the API /v2/conversations/{conversation_id}, we don’t see anything that says the conversation was resolved and expired because of threading.
We were able to identify it only when we send a message to that conversation. When we send a message to a conversation using the API POST /conversations/{conversation_id}/messages
which got expired because of threading, we get this response
response: ‘{“code”:400,“status”:“BAD_REQUEST”,“message”:“Conversation ID 123-456-789-CONVERSATION-ID passed is not the latest conversation for this topic.”}’.
Is there any other way to find whether the conversation is expired other than this.
I understand that you’re looking for an alternative solution to find out whether a conversation has expired in Freshchat due to threading enabled, without sending a message to it.
Based on Freshchat’s API documentation, there isn’t a direct way to determine if a conversation is expired or resolved solely by fetching the conversation information. However, I suggest a possible workaround to minimize sending messages to potentially expired conversations:
Fetch conversation details with /v2/conversations/{conversation_id}.
Look for the “last_updated_time” field in the response. It contains the timestamp of the last update made to the conversation.
Compare this timestamp with the duration set for conversation expiration in Freshchat settings (if it’s fixed and known beforehand).
If the time difference exceeds the expiration duration, you can assume the conversation is likely expired.
Please note that this workaround might not be 100% accurate as it’s based on assumptions, but it could help minimize the interactions with expired conversations. It’s always good to consult with Freshchat support for more information or possible upcoming features related to this issue.
Yes, you can use the “conversation update” webhook event in Freshchat to listen for changes in conversations, which includes whether a conversation is closed or not. Here’s how you can set it up:
Go to your Freshchat dashboard and navigate to the “Settings” section.
In the “Settings” section, click on the “Webhooks” tab.
Click “Add Webhook” to create a new webhook event listener.
Now, you need to provide a webhook URL from your application. This URL will receive updates whenever there’s a change in the conversation status.
In the “Event” dropdown, select the “conversation update” event option.
Once the webhook is set up, your specified URL will receive notifications whenever a conversation’s status changes, including when it’s closed or resolved.
You can then process these notifications in your application to check if the conversation is closed or not, without having to send messages to the conversation. For more information on handling webhook events with Freshchat, I recommend consulting their API documentation: https://developers.freshcaller.com/docs/webhooks/
Keep in mind that you might want to perform validation and handle errors for incoming webhook events in your application to ensure data consistency and security.