Twilio¶
URL Format¶
twilio://ACCOUNT_SID:AUTH_TOKEN@FROM_NUMBER/TO_NUMBER_1[/TO_NUMBER_2/...]
URL Fields¶
- AccountSID - Twilio Account SID (Required)
URL part: User - AuthToken - Twilio Auth Token (Required)
URL part: Password - FromNumber - Sender phone number or Messaging Service SID (Required)
URL part: Host - ToNumbers - Recipient phone number(s) (Required)
URL part: Path
Query/Param Props¶
Props can be either supplied using the params argument or through the URL using
?key=value&key=value etc.
- title - Notification title Default: empty
Getting Started¶
To use the Twilio SMS service, you need a Twilio account. You can sign up at twilio.com.
Required Credentials¶
- Account SID — Found on your Twilio Console Dashboard
- Auth Token — Found on your Twilio Console Dashboard
- From Number — A Twilio phone number or Messaging Service SID from your account
- To Number(s) — One or more recipient phone numbers in E.164 format
An Account SID is AC followed by 32 hexadecimal characters, and a URL with any other value is rejected.
Phone Number Format¶
Phone numbers should be in E.164 format (e.g. +18005550100).
Common formatting characters such as spaces, dashes, parentheses, and dots are
automatically stripped, so +1 (800) 555-0100 and +1.800.555.0100 are also accepted.
Multiple Recipients¶
You can send the same message to multiple recipients by adding additional phone numbers to the URL path:
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@+18005550100/+18005550101/+18005550102/+18005550103
Each recipient receives an independent API call. If delivery fails for one recipient, the remaining recipients are still attempted and all errors are returned together.
Messaging Service SID¶
Instead of a phone number, you can use a Twilio Messaging Service SID as the sender. Messaging Service SIDs start with MG:
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@MG0123456789abcdef0123456789abcdef/+18005550101
This is useful when you want Twilio to manage sender selection, opt-out handling, or when sending from a pool of numbers.
Examples¶
The examples use a sample Account SID and Messaging Service SID, which have the format the service checks.
Replace them and AUTH_TOKEN with the values from your Twilio Console.
Basic SMS
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@+18005550100/+18005550101
Multiple recipients
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@+18005550100/+18005550101/+18005550102
Using a Messaging Service SID
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@MG0123456789abcdef0123456789abcdef/+18005550101
SMS with title
twilio://AC0123456789abcdef0123456789abcdef:AUTH_TOKEN@+18005550100/+18005550101?title=Server+Alert
Optional Parameters¶
You can optionally specify the title parameter in the URL. When set, the title is prepended to the message body.
Please refer to the Twilio SMS API documentation for more information.