Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions examples/public_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,24 @@
from twilio.credential.client_credential_provider import ClientCredentialProvider

ACCOUNT_SID = os.environ.get("TWILIO_ACCOUNT_SID")
API_KEY = os.environ.get("TWILIO_API_KEY")
API_SECRET = os.environ.get("TWILIO_API_SECRET")
FROM_NUMBER = os.environ.get("TWILIO_FROM_NUMBER")
TO_NUMBER = os.environ.get("TWILIO_TO_NUMBER")
MESSAGE_SID = os.environ.get("TWILIO_MESSAGE_SID")

CLIENT_ID = os.environ.get("TWILIO_CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
CLIENT_SECRET = os.environ.get("TWILIO_CLIENT_SECRET")


def example():
"""
Some example usage of message resources.
An example usage of message resource.
"""
client = Client(
account_sid=ACCOUNT_SID,
credential_provider=ClientCredentialProvider(CLIENT_ID, CLIENT_SECRET),
)

msg = client.messages.create(
to=self.to_number, from_=self.from_number, body="hello world"
)
msg = client.messages(MESSAGE_SID).fetch()

print(msg)


if __name__ == "__main__":
Expand Down
Loading