Build the future of communications.
Start building for free

Announcing Passthrough API: Send 10k SMS messages with a single API request

Passthrough-api-launch-notify

  • Bulk SMS through a single API request.
  • Make marketing announcements, send emergency response notifications.
  • Available in beta.

We are excited to announce Passthrough API—an addition to the Notify API that simplifies the way developers can build bulk SMS in their applications.

In the past, if developers needed to notify many users, they’d have to do so by making a unique API request per recipient from their list of user addresses. If this list was too long, making API requests would consume too much time.

Now, businesses can send bulk SMS notifications with a single API request via Twilio Notify. What’s even better is that it can be used not just for SMS, but for all the other channels supported by Notify like iOS and Android push notifications, web push via FCM and APNS, and Facebook Messenger. You can even mix multiple channels in a single request.

What this means for developers: 

  • Simpler application – One API request to send up to 10,000 SMS messages
  • Multichannel support – One API request to run multi-channel campaigns

Passthrough API is useful if you need to:

  • Make marketing announcements Companies collect contact data (addresses such as phone numbers) from a number of applications, website sessions, and referrals. This is typically stored, analyzed and segmented to create a target list in the CRM system. Once the target list is identified, all you need to do is just use that list and make a single request to Twilio that notifies everyone on the list across all channels.
  • Send emergency notifications – In the event of a service disruption, companies might need to inform their customers about the events—usually in a reliable and timely manner. Sending this information on multiple channels is a good way to increase your chances of getting notified. With the Passthrough API, this just got simpler—you can use a single API request to update all your customers on all available channels.
  • Send disaster alerts – If there’s been a natural disaster, help centers need to inform disaster zone residents about things such as helplines and first aid. What’s more critical is that this information needs to be conveyed in a timely manner. With the Passthrough API, you can use a single API request to send multi-channel bulk SMS messages or notifications to your entire database of residents in the affected area.

How it Works

You can send notifications to addresses without storing them by using the toBinding parameter. However, the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers.

toBinding Parameter: The destination address in a JSON object.

toBinding Attributes:

  • binding_type – The channel to be used. Possible values: sms, apn, gcm, fcm, facebook-messenger.
  • address – The destination address. For SMS it is the phone number in E.164 format. For APNS, GCM and FCM it is the device or registration token. For Facebook Messenger it is the Messenger ID.

Here’s an example of how to use the toBinding parameter to send multi-channel notifications without storing addresses in Notify.

# NOTE: This example uses the next generation Twilio helper library - for more
# information on how to download and install this version, visit
# https://www.twilio.com/docs/libraries/python
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account = "AC98e9a2817c2e0b4d38b42d1445ef42d9"
token = "your_auth_token"
client = Client(account, token)

notification = client.notify.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")\
    .notifications.create(
        to_binding=[
            "{\"binding_type\":\"sms\",\"address\":\"+15555555555\"}",
            "{\"binding_type\":\"facebook-messenger\",\"address\":\"123456789123\"}"
        ],
        body="Hello Bob")

print(notification)

 

Now that you know how to use Twilio’s Passthrough API, you can send all of your friends a reminder about your big birthday coming up with a single API request (that’s what I’m going to use it for)!
We can’t wait to see what you build!

Authors
Sign up and start building
Not ready yet? Talk to an expert.