I have a list of ~50 phone numbers I need to send the same SMS to via Twilio's API. How do I do that (via Python)?
I can do it in a for loop like so:
from twilio.rest import Client
client = Client(SID, AT)
for number in number_list:
client.messages.create(to=number, from_="+18328955063",body="foo bar")
But instead of hitting Twilio's API multiple times, I'd rather send an array/list of phone numbers in bulk and just make one API call. So how do I do that? Is it possible at all?
I'm setting up a background async task to take care of outgoing text messages, and ideally wouldn't want my task to wait a long time while Twilio processes the messages one by one. I'd just want to send over a list of numbers as payload and be done with it.