I’m developing an app that allows users to add people, info, and Name/phone, or select multiple numbers from their iPhone contact list to send SMS messages to the selected numbers. the problem is Twillio API needs to be call every time per number. Is their any way to call the API once for multiple numbers?
- Is it possible to send message to multiple number at a time?
- Is it possible to send multiple messages?
Thanks in advance
5
Answers
It’s not possible, you need to iterate through the list and make one request per message (which is probably better than batching it and dealing with the potential of multiple errors / resends).
Yes it is possible to send message to multiple user’s from your Twilio Number.
You can try this for your node.js file:
Each new SMS message from Twilio must be sent with a separate REST API request. To initiate messages to a list of recipients, you must make a request for each number to which you would like to send a message. The best way to do this is to build an array of the recipients and iterate through each phone number.
Yes it is possible. You have to provide the numbers as a list and iterate API call.
For example send a message to two numbers.
Yes this is possible. Infact i’m trying to do the same thing at the moment(which is why i’m here) and Twilio has some advanced stuff that lets us achieve this.
Assuming you have a twilio ssid, twilio auth token and a twilio phone number, the next thing you have to do is create a "Twilio Messaging Service" from the dashboard. You can use the ssid of the created messaging service and use or if you want to send a message to like 10k numbers in one go, you create a "Twilio Notify Service" from the dashboard which takes the previously created messaging service as part of its configuration. Once this is done you can call the
twilio.notifications.create()
and pass bindings({ binding_type: ‘sms’, address: number }) for each phone number to it.Complete explanation found in this twilio blog right here with perfectly working code.
https://www.twilio.com/blog/2017/12/send-bulk-sms-twilio-node-js.html