Skip to content

Instantly share code, notes, and snippets.

@thinkingserious
Created March 15, 2019 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkingserious/9383ba2f509ba030c931810d97492188 to your computer and use it in GitHub Desktop.
Save thinkingserious/9383ba2f509ba030c931810d97492188 to your computer and use it in GitHub Desktop.
Send a SMS via Twilio and Pythonista on iOS
import requests
from requests.auth import HTTPBasicAuth
to_number = 'outgoing_number'
from_number = 'your_twilio_number'
message = 'Thank for your order, we will deliver after our cookie booth sale at around 6pm.'
account_sid = 'your_account_sid'
auth_token = 'your_auth_token'
auth = HTTPBasicAuth(account_sid, auth_token)
url = 'https://api.twilio.com/2010-04-01/Accounts/{}/Messages'.format(account_sid)
values = {
'To' : to_number,
'From' : from_number,
'Body' : message,
}
response = requests.post(url, data = values, auth = auth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment