Twilio
| Schemes | twilio:// |
| Cargo feature | service-twilio |
| Service | https://www.twilio.com/ |
| Body formats | text (first is the default) |
| Attachments | no |
| Title length | no title (merged into the body) |
| Body length | 160 characters |
| Body lines | unlimited |
| Request throttle | 200 ms between requests |
| Vendor URLs accepted | no |
URL formats
{schema}://{account_sid}:{auth_token}@{from_phone}
{schema}://{account_sid}:{auth_token}@{from_phone}/{targets}
{schema} is one of twilio://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{account_sid} | Account SID | string | yes | secret; must match ^AC[a-f0-9]+$ | |
{auth_token} | Auth Token | string | yes | secret; must match ^[a-z0-9]+$ | |
{from_phone} | From Phone No | string | yes | must match ^([a-z]+:)?\+?[0-9\s)(+-]+$ | |
{short_code} | Target Short Code | string | no | must match ^[0-9]{5,6}$ | |
{target_phone} | Target Phone No | string | no | prefix +; must match ^([a-z]+:)?[0-9\s)(+-]+$ | |
{targets} | Targets | list | no | any of short_code, target_phone; separated by / |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
apikey | API Key | string | secret; must match ^SK[a-f0-9]+$ | |
from | From Phone No | string | sets {from_phone}; also source | |
method | Notification Method: sms or call | choice | sms | one of sms, call |
sid | Account SID | string | sets {account_sid} | |
to | Targets | list | sets {targets} | |
token | Auth Token | string | sets {auth_token} |
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@55555555555
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@12345/44444444444
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@98765/44444444444/w:55555555555/
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@33333333333/123/999999999999999/abcd/w:88888888888
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@55555555555?method=sms
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@15551233456/15559876543?method=call
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@15551233456/w:15559876543/15559876544?method=call
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@_/66666666666/t:77777777777?from=whatsapp:55555555555
Rejected URLs:
twilio://
twilio://:@/
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@12345678
twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@_
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'twilio://ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@55555555555'
Notes
Twilio SMS / WhatsApp / voice calls (twilio://): messages and calls through the Twilio API.