Message Resource Reference for the Twilio Messaging REST API - Twilio

PHOTO EMBED

Tue May 25 2021 07:39:19 GMT+0000 (UTC)

Saved by @faheem99

# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client


# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

message = client.messages.create(
                              from_='+15017122661',
                              body='body',
                              to='+15558675310'
                          )

print(message.sid)
content_copyCOPY

https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource