0

I need to fetch the list of conversations created on certain date e.g 2021-06-22.

However

curl -X GET 'https://conversations.twilio.com/v1/Services/IS_service_sid/Conversations?PageSize=20' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

returns only a list of arbitrary 20 records from any dates.

I have tried filtering by passing --data-urlencode "DateCreated=2021-06-22" with curl but it doesn't seem to do anything.

Interestingly nothing about filtering by date or any kind of sorting described in the documentation: https://www.twilio.com/docs/conversations/api/conversation-resource

rockneverdies
  • 180
  • 1
  • 7

1 Answers1

3

Twilio developer evangelist here.

Filtering is not supported at the moment. It is sometimes recommended that customers dump Conversations events into elasticsearch or a db or something using the post-action webhook if they want to be able to do advanced searching. To be honest, Twilio engineers don't really want users to be using the REST API as a focused lookup tool as it's not optimized for that. It is much faster and better to keep a representation of your instance in a database if you want to do advanced queries on their data (this is how I'd also recommend implementing message searching like Slack has.)

Let me know if this helps at all!

lizziepika
  • 3,231
  • 1
  • 14
  • 23
  • 1
    Thanks for the answer @lizziepika. I see now. However I don't agree that this should be counted as advanced searching at all. This is very simple stuff. I mean ok don't support any kind of searching but at least serve the data in descending/ascending order by its creation date. As it is now, it is so useless. – rockneverdies Jun 25 '21 at 11:15
  • twilio will be adding filters in the future-- it's on the roadmap for now though, using your own database or elasticsearch cluster is the best way to achieve what you want – lizziepika Jun 25 '21 at 17:05