-
-
Save manniru/11397033 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twilio.rest import TwilioRestClient | |
class TwilioSMS: | |
def __init__(self): | |
self.account_sid = "AC0b56c1b6b1ff87e0caaf2c41ee5a7380" | |
self.auth_token = "d788a0bac58674a4efdd8fdb86c201a6" | |
def viewsms(self): | |
client = TwilioRestClient(self.account_sid, self.auth_token) | |
sms = client.sms.messages.get("SM0aa437df1e14e2fbbc385ee2988c1cdb") | |
return sms.body | |
def makeCall(self): | |
client = TwilioRestClient(self.account_sid, self.auth_token) | |
call = client.calls.create(to="+2348033099431", | |
from_="+14242851118", | |
url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient") | |
return call.sid | |
def sendSMS(self, phone, message): | |
client = TwilioRestClient(self.account_sid, self.auth_token) | |
message = client.messages.create(to = phone, from_="+14242851118", body=message) | |
return message | |
twilio = TwilioSMS() | |
#print twilio.viewsms() | |
#print twilio.makeCall() | |
print twilio.sendSMS('+2348033099431', 'Twilio SMS Test from Google Appengine from Python') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment