Scripting Twilio

User avatar
FlyingDiver
Posts: 7283
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Scripting Twilio

Post by FlyingDiver »

Sending SMS messages is scriptable:

Code: Select all

twilio = "com.flyingdiver.indigoplugin.twilio"
twilioPlugin = indigo.server.getPlugin(twilio)
if twilioPlugin.isEnabled():
   twilioPlugin.executeAction("sendSMS", deviceId=XXXXXXX,  props={'smsTo':'+12125550123', 'smsMessage':'Put something interesting here.'})


As is placing a voice call:

Code: Select all

twilio = "com.flyingdiver.indigoplugin.twilio"
twilioPlugin = indigo.server.getPlugin(twilio)
if twilioPlugin.isEnabled():
   twilioPlugin.executeAction("voiceCall", deviceId=XXXXXXX,  props={'smsTo':'+12125550123', 'bucket':'<hold music bucket>'})


<hold music bucket> can be any one of the following, or some other Twilio compatible S3 storage bucket.

    "com.twilio.music.ambient"
    "com.twilio.music.classical"
    "com.twilio.music.electronica"
    "com.twilio.music.guitars"
    "com.twilio.music.newage"
    "com.twilio.music.rock"
    "com.twilio.music.soft-rock"

This action uses the Twilio holdmusic Twimlet: https://www.twilio.com/labs/twimlets/holdmusic
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Return to “Twilio”