CP-Twilio-Python-Text-App icon indicating copy to clipboard operation
CP-Twilio-Python-Text-App copied to clipboard

issue on running sms_py

Open 1alikadri opened this issue 4 years ago • 2 comments

Traceback (most recent call last): File "C:/Users/Mohammed Ali/AppData/Local/Programs/Python/Python37/send_sms.py", line 5, in client = TwilioRestClient(account_sid, auth_token) File "C:\Users\Mohammed Ali\AppData\Local\Programs\Python\Python37\lib\site-packages\twilio\base\obsolete.py", line 20, in new_func .format(func.name) twilio.base.obsolete.ObsoleteException: TwilioRestClient has been removed from this version of the library. Please refer to current documentation for guidance.

i am having this issue please help me out

1alikadri avatar Apr 23 '20 15:04 1alikadri

Just replace TwilioRestClient with Client as it works with newer version of twilio.

sarveshggn avatar May 02 '20 17:05 sarveshggn

from twilio.rest import Client # Import using Client

Replace these with your own Twilio account credentials

account_sid = "AC994237b93e91ce32c9a6917a5a1529a4" auth_token = "4282f5115a35df78a81977365d8038ac" my_cell = "+91 89195 36123" my_twilio = "+14158959911"

client = Client(account_sid, auth_token) # Use Client for newer versions

my_msg = 'Your message goes here...'

message = client.messages.create(to=my_cell, from_=my_twilio, body=my_msg)

shaikayesha-sk avatar Mar 17 '24 04:03 shaikayesha-sk