2
votes

I want to send a SMS to my Twilio number and on receipt to forward it (POST/GET) to my URL.

I would not like to be checking Twilio for new messages each minute as they are really few (20 SMS a day at max) and sent at random intervals so pooling seems like a waste of resources, also I need to take action inmediatly on message received so I would have to have an interval of max 1min if doing it this way.

so if Twilio could "push" the SMS on receipt to some URL, it would be great.

How could I accomplish this with Twilio?

Thank you

2

2 Answers

4
votes

Twilio evangelist here.

Good news! Twilio actually works exactly the way you want. We use something called a webhook to let you know when someone sends an inbound SMS to your Twilio number, and its really easy to configure that webhook. If you log into your Twilio dashboard and click on the Numbers tab you will see your Twilio phone number:

enter image description here

Now click on that phone number to go to the configuration page for than number.

On that page you will see two input fields, one labeled Voice Request URL and the other labeled Message Request URL. These two values let you tell Twilio what URL you want us to request when someone either makes a voice call or sends an SMS to your Twilio number. If you only care about inbound SMS messages, then you only need to put a URL in the Message Request URL field.

enter image description here

Once you've filled in the SMS Message URL you just need to write a webpage that lives at URL. That webpage can also retrieve a set of parameters that Twilio sends when it makes it request to it.

Hope that helps.

0
votes