使用Python上的Twilio发送短信

2024-03-28 17:22:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我输入了提供的示例代码,很明显,我将自己的信息替换为必要的位置:

from twilio.rest import Client

account_sid = "ACf2a49cff3675efb3344c603ef08748ef"
auth_token = "myauthtoken"
client = Client(account_sid, auth_token)

message = client.messages.create(
    to="+mynumber", 
    from_="+twilionumber", 
    body="Hi its Gitty!")

print(message.sid)

我收到了一条错误信息:

^{pr2}$

我在其他地方读到,我可能需要重新安装urllib3或升级它,这两个我都做了,但仍然没有更改我的错误消息。帮忙吗?在


Tags: 代码fromimportclienttokenauthrest信息