Send SMS to Multiple Phone Numbers

I have my Argon & Twilio setup to allow me to text one number when I press a button.

I would like to send the text to multiple phones when a button is pushed. Do I need to set up a webhook for each number? Or is there a service other than Twilio?

The button is for when someone in the room needs assistance and I want to alert several people to get help there as fast as possible.

I believe that the Twilio programmable message API only allows a single recipient per REST API call. You could get around this by setting up multiple webhooks that trigger off a single event trigger.

You could also use a different service. I've used EZTexting in the past. It's more geared toward mass-texting, but because of that it's ideal for sending to multiple recipients configured within the service.

1 Like

This is the code I'm using now, pretty basic, but it works for one text when I push the button:

int buttonPin = 3;
int buttonState = LOW;

String body = "Hey, Who Pushed that Button!";

void setup() {
pinMode(buttonPin, INPUT);

}

void loop() {

buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {
    
    Particle.publish("twilio_sms", body, PRIVATE);
            
delay(5000);
}
    }

I have tried adding a second webhook under Particle.io Integrations, basically coping the first one. It does not send out the SMS to the second cell phone.

Can I change the Event name to something different, or since I'm using Twilio, does it have to stay twilio_sms?

Hi, can you check if it is getting triggered, or if it is failing to execute?
You can do so from the bottom of the integration page itself:

The second webhook does not go through. Under the LOGS section it has a red X on it, next to the date/time. I do not see the section called "Event". It is not there on the webhook that is texting or the one that is not.

Does the webhook pass on the Event name to Twilio or just the other parameters? Does Twilio need the Event name to be twilio_sms?

When I did a test of the webhook using the TEST button at the top of the webhook page I did get an error popup.

It said I had an "error status 400 from api.twilio.com"

I got it figured out. Thanks for being a sounding board...

I did not put a "1" in front of my phone number I was trying to send to. Sometimes it's the little things that count!

2 Likes