user2565735
user2565735

Reputation: 119

Twilio Fetch Incoming SMS messages (without webhook)

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!

Upvotes: 3

Views: 2428

Answers (2)

philnash
philnash

Reputation: 73027

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.

Upvotes: 1

yvesonline
yvesonline

Reputation: 4837

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.

Upvotes: 0

Related Questions