3

Is there any API to retrieve the list of incoming SMS messages or incoming SMS from specific phone number without using web-hook? My scenario would be gather incoming messages without respond back.So, we can call API whenever we need to fetch all incoming SMS messages list or incoming message specific to the given number. Thanks in advance!

user2565735
  • 119
  • 2
  • 6
  • Hello.. My use case is very similar to yours. Did you figure out how to retrieve all incoming SMS messages to a Twilio phone number? All the examples are for outgoing messages. I am looking for a way to get the incoming messages. Appreciate any help you could provide. – Vinodh M Aug 02 '23 at 22:52

2 Answers2

1

Twilio developer evangelist here.

You can list messages from a specific phone number using the Message Resource.

You can filter the list by the "From" number, the "To" number or the date the message was sent.

philnash
  • 70,667
  • 10
  • 60
  • 88
0

One way to do this would be using Twilio Functions and Amazon SQS. You can then poll SQS at your leisure to fetch the queued messages. There's a good Twilio Blog article called Handling High Volume Inbound SMS and Webhooks with Twilio Functions and Amazon SQS explaining the approach. Looking at your scenario you could have different queues for different numbers and accomplish what you're asking for.

That being said using a Twilio Function you can also store your SMS in a AWS DynamoDB table or similar if this suits your needs better.

yvesonline
  • 4,609
  • 2
  • 21
  • 32