0

My question is about the following APIs:

What is the ordering of the conversations returned by the above APIs? Are they ordered by most/least recent activity? Most/least recent creation time? Or is the ordering undefined?

RvPr
  • 1,074
  • 1
  • 9
  • 26

2 Answers2

2

I came across this post after I had asked twilio support about how responses are ordered for https://www.twilio.com/docs/conversations/api/user-conversation-resource#list-all-of-a-users-conversations

The response from support was they are sorted alphabetically by Conversation Sid. My limited testing confirmed the response.

I asked support to pass a feature request to the Conversations product team- allow the sort key to be included with the request.

jimk
  • 23
  • 5
1

I had to check this with the conversations team, the ordering of conversation resources is undefined and you should not necessarily rely on the order.

If you want to keep an order of conversations, particularly most recent activity, you could set up webhooks to receive updates when a message is added or updated and store that last updated time against conversation IDs in your own database and use that to order them in the client side.

philnash
  • 70,667
  • 10
  • 60
  • 88