Question
How can I manually add phone numbers or subscribers to my Broadcast SMS application using Twilio Notify? I followed the instructions to set up the Broadcast SMS app on Twilio Functions, but I want to manually enter phone numbers into my subscriber list when users opt in on my website.
Product
Twilio Notify
Environment
Twilio Console
Answer
The Broadcast SMS application uses Twilio Notify under the hood to manage subscriber lists using objects called Bindings.
To manually add a phone number to your subscriber list, send an HTTP POST request to the Twilio Notify Bindings API endpoint using cURL or your preferred API client:
curl -X POST "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings"
\ --data-urlencode "Identity=+15558675309"
\ --data-urlencode "BindingType=sms"
\ --data-urlencode "Address=+15558675309"
\ -u "YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN"
Additional Information
All phone numbers must be formatted in standard E.164 format (e.g., +1 followed by the 10-digit number for US numbers).