Skip to content

Commit 50a271c

Browse files
docs: update oauth example (#886)
1 parent 615fb81 commit 50a271c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

examples/public_oauth.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,24 @@
44
from twilio.credential.client_credential_provider import ClientCredentialProvider
55

66
ACCOUNT_SID = os.environ.get("TWILIO_ACCOUNT_SID")
7-
API_KEY = os.environ.get("TWILIO_API_KEY")
8-
API_SECRET = os.environ.get("TWILIO_API_SECRET")
9-
FROM_NUMBER = os.environ.get("TWILIO_FROM_NUMBER")
10-
TO_NUMBER = os.environ.get("TWILIO_TO_NUMBER")
7+
MESSAGE_SID = os.environ.get("TWILIO_MESSAGE_SID")
118

129
CLIENT_ID = os.environ.get("TWILIO_CLIENT_ID")
13-
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
10+
CLIENT_SECRET = os.environ.get("TWILIO_CLIENT_SECRET")
1411

1512

1613
def example():
1714
"""
18-
Some example usage of message resources.
15+
An example usage of message resource.
1916
"""
2017
client = Client(
2118
account_sid=ACCOUNT_SID,
2219
credential_provider=ClientCredentialProvider(CLIENT_ID, CLIENT_SECRET),
2320
)
2421

25-
msg = client.messages.create(
26-
to=self.to_number, from_=self.from_number, body="hello world"
27-
)
22+
msg = client.messages(MESSAGE_SID).fetch()
23+
24+
print(msg)
2825

2926

3027
if __name__ == "__main__":

0 commit comments

Comments
 (0)