使用Twilio API向WhatsApp沙箱用户发送消息

时间:2020-05-06 12:53:35

标签: python twilio twilio-api

我正在尝试向我的Twilio沙箱中的用户(用户就是我自己)发送whatsapp消息。当我从API文档运行代码时,没有收到消息。我的沙箱已设置。

代码

from twilio.rest import Client
account_sid = 'ACda1a****'
auth_token = 'f6d7****'
client = Client(account_sid, auth_token)

message = client.messages.create(
         from_='whatsapp:+14155238886',
         body="It's taco time!",
         to='whatsapp:+****')

print(message.sid)

当我在终端上运行代码时,我在终端上打印出了message.sid的输出,但未在whatsapp上收到消息。我的Twilio调试器中也没有收到错误消息

0 个答案:

没有答案