Hi Team,
Is there any possible way to fetch latest 10 conversation of a ticket?
Thanks,
Tejasri
Hi Team,
Is there any possible way to fetch latest 10 conversation of a ticket?
Thanks,
Tejasri
Hi,
Can anyone help me on this as this high priority
Thanks,
Tejasri
Hi @Tejasri_Kalluri,
We have API’s in freshdesk to fetch the latest 10 conversations using the endpoint
/api/v2/tickets/[id]?include=conversations
In case you need to fetch all the conversations in a ticket. Check the following end point.
/api/v2/tickets/[id]/conversations
Hope it helps
/api/v2/tickets/[id]?include=conversations
i have used this, here it is returning from starting(first conversation of the ticket to 10th conversation) not returning latest 10 conversations and in document clearly mentioned that “will return up to ten conversations sorted by “created_at” in ascending order.” but i need in descending order this there any possible way
/api/v2/tickets/[id]/conversations
this returning all conversations upto 30
actually my requirement is suppose having 45 conversations in a ticket, there need to fetch latest 10 conversations of that ticket, without pagination can you help in this
Warm Regards,
Tejasri.
Unfortunately i din’t find API to get the latest 10 conversation without pagination.
What are you trying to achieve using the conversation details? (eg : display conversation details, email address etc)
Thanks,
Sarfaraz
when i create a child ticket need to fetch latest 10 conversationss from parent and post in the child ticket. But iterating all conversations some times leads to API rate limits and timeout issues as it is SMI. So to resolve this I need the latest 10 convs. If there are any filters also it may be helpful like sort_by etc.
Thanks,
Tejasri
Hi @Tejasri_Kalluri,
I couldn’t find the right API or the right filter on any API. Let me check with Freshdesk product team if there’s any other way or workaround for this.
Otherwise I will take it up a feedback to pass it to the product team.
Just a quick thought will it be possible that you can fetch all the ticket conversation details before making SMI call and send the conversation payload as an argument in SMI call.
@Tejasri_Kalluri This is currently not possible with Freshdesk API.
I will take it up as a feedback to pass it to the Freshdesk product team.
Please consider if @sarfaraz_Mohammed’s suggestion would work as a workaround. But, I suspect this would cause Request API rate-limit breach.
Use this to fetch all the tickets in descending order
async getAllConversations() {
let loop = true;
let page = 1;
let result: any;
let conversations: any[] = [];
while (loop) {
result = await this.getConversationsPage(page);
conversations = conversations.concat(result);
page ++;
if (result.length != 30) {
loop = false;
}
}
conversations = conversations.filter(c => !c.private);
conversations.sort((a, b) => (new Date(a.updated_at) > new Date(b.updated_at)) ? -1 : 1);
return conversations;
}
getConversationsPage(page: number) {
return this._freshdeskService.getTicketConversations(this.ticketId, page).toPromise();
}
Hi Riviraj,
Was there a solution for this?
I tried the list all conversations option and hit the API rate limit issue.
I have checked with the product team. No updates on this yet, Rob.
OK. Thanks for asking Riviraj
This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.