File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 4
4
from twilio .credential .client_credential_provider import ClientCredentialProvider
5
5
6
6
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" )
11
8
12
9
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 " )
14
11
15
12
16
13
def example ():
17
14
"""
18
- Some example usage of message resources .
15
+ An example usage of message resource .
19
16
"""
20
17
client = Client (
21
18
account_sid = ACCOUNT_SID ,
22
19
credential_provider = ClientCredentialProvider (CLIENT_ID , CLIENT_SECRET ),
23
20
)
24
21
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 )
28
25
29
26
30
27
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments