twiliotwilio-apitwilio-conversations

Is there any ability to do an indexed search of Twilio Conversation Messages from the API?


Does the service/api have any full-text searching capability across all conversation messages in an account? I'm trying to avoid having to save all messages to some indexed datasource of my own (would likely use a managed datastore in the cloud).

Nothing is standing out in the documentation.


Solution

  • At this point in time, the Conversations APIs do not offer the ability to search across all Messages within a Twilio Account or Service.

    That said, Conversation Messages are able to be retrieved based on the Conversation and Service that they are a part of.

    Conversation Message Resource: https://www.twilio.com/docs/conversations/api/conversation-message-resource#list-all-conversation-messages

    Service-scoped Conversation Message Resource: https://www.twilio.com/docs/conversations/api/service-conversation-message-resource#read-all-service-scoped-conversation-message-resources

    As the noted alternative would include retrieving Conversation Message details from your own datastore, Conversations Webhooks (in particular onMessageAdded) can be used to reduce the amount of API calls for your account and have message details automatically delivered to your datastore for indexing and searching later.

    Conversations Webhooks - onMessageAdded: https://www.twilio.com/docs/conversations/conversations-webhooks#onmessageadded