Skip to content

Commit 518f1ca

Browse files
committed
TWillio python whatsapp
1 parent 15ba91b commit 518f1ca

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
4.23 MB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Download the helper library from https://www.twilio.com/docs/python/install
2+
from twilio.rest import Client
3+
4+
5+
# Your Account Sid and Auth Token from twilio.com/console
6+
# DANGER! This is insecure. See http://twil.io/secure
7+
account_sid = ''
8+
auth_token = ''
9+
client = Client(account_sid, auth_token)
10+
11+
message = client.messages \
12+
.create(
13+
body='Esta es una prueba desde twillio http://www.yummycupcakes.com/',
14+
from_='+12565679055',
15+
to='+50245020197'
16+
)
17+
18+
print(message.sid)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from twilio.rest import Client
2+
3+
# Your Account Sid and Auth Token from twilio.com/console
4+
# DANGER! This is insecure. See http://twil.io/secure
5+
6+
account_sid = ''
7+
auth_token = ''
8+
client = Client(account_sid, auth_token)
9+
msg_body = "Your Yummy Cupcakes Company order of 1 dozen frosted cupcakes has shipped and should be delivered on July 10, 2019. Details: http://www.yummycupcakes.com/"
10+
11+
message = client.messages \
12+
.create(
13+
body= msg_body,
14+
status_callback='http://postb.in/1234abcd',
15+
media_url=['https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png'],
16+
from_='whatsapp:+14155238886',
17+
to='whatsapp:+50245020197'
18+
)
19+
print(message.sid)

0 commit comments

Comments
 (0)