Solved

Getting Recent Conversations & Conversation Messages

  • 1 February 2023
  • 3 replies
  • 279 views

Badge

I’m attempting to get conversations for the last day and see that the “List Conversations” returns conversations sorted by most recent first. But there’s no great way of validating recency. I’ve resorted to pulling all messages for each conversation and checking to see that at least 1 message was created within the last day.

Seeing as the List Conversations endpoint is doing some sort of server-side sorting with an updated_at property, is it possible to expose that so I can key off of it at as well? This would also be helpful when searching conversations too.

Or if there’s some other way of getting this information please let me know.
 

Thanks in advance!

icon

Best answer by Support Engineering 7 February 2023, 00:35

View original

3 replies

Userlevel 5
Badge +8

Hi Kirk,

 

Please excuse the delay getting back to you. Our team should have a response shortly!

Badge

I have a similar question. We have been trying to figure out a way to get updates of conversations that have been updated or created since a given date using the list conversations endpoint.

We managed to achieve a similar effect using the events endpoint while specifying the interval with after and before parameters. But in doing so we need to do extra calls to retrieve the conversation data and also potentially multiple events occur for the same conversation, which results in lots of extra calls and doesn't seem to be the most optimized way to retrieve updates.

So I’m also interested if there are better ways of getting recent updates of conversations.

Userlevel 1
Badge +5

Hi Kirk,

To provide a similar Conversation list to what appears in-app when sorting by Newest or Oldest, our API orders conversations with the Company preference Bump and reopen conversations in team inboxes:

 

https://help.front.com/t/y729th/customize-when-conversations-bump-up

 

This feature allows teams to customize whether replies or comments will “bump” a conversation up the list in-app.  This time, which we’ll call bumped_at, is used to order conversations from the List Conversation route.  This isn’t a field that appears on the conversation resource directly, and relates to the conversation’s events, out_reply and comment, in the context of the above setting.

Rather than changing this in-app setting, you might find it easier to use List Events:

https://dev.frontapp.com/reference/get_events

 

This route allows you to filter for message events in a certain time period.  For example, if you wanted all inbound and outbound events after February 5th:

https://api2.frontapp.com/events?q[after]=1675573200&q[types]=inbound&q[types]=outbound


--
Evan - Support Engineering

Reply