def send_sms():
"""Sends a simple SMS message."""
to = request.args.get('to')
if not to:
return ('Please provide the number to message in the "to" query string'
' parameter.'), 400
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
rv = client.messages.create(
to=to,
from_=TWILIO_NUMBER,
body='Hello from Twilio!')
return str(rv)
# [END send_sms]
# [START receive_sms]
评论列表
文章目录