TwilioriestClient已删除

2024-05-17 02:55:17 发布

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

tClient= TwilioRestClient(sid, token)

此代码引发异常:

twilio.base.obsolete.ObsoleteException: TwilioRestClient has been removed from this version of the library. Please refer to current documentation for guidance.

好像在任何地方都找不到这方面的参考,这在几天前起作用了!在

使用python 3.7和VS2017


Tags: 代码fromtokenbaseversionthishasbeen
2条回答

TwilioRestClient已折旧,删除“TwilioRestClient”字样,并替换如下:

from twilio.rest import Client

account = "Account number for Twilio"
token = "Token for Twilio Account"

client = Client(account, token)

message = client.messages.create(to="+ReceiverPhone#", from_="+TwilioPhone#",
                             body="Text message you are sending to receiver")
#print response back from Twilio
print message

使用

从斜纹。休息导入客户端 tClient=客户端(sid,token)

因为TwilioRestClient已被弃用。在

相关问题 更多 >