使用twilio API在python中发送SMS时出错
我试图发送短信,但我收到了这个错误使用twilio API在python中发送SMS时出错,python,python-3.x,twilio,twilio-api,Python,Python 3.x,Twilio,Twilio Api,我试图发送短信,但我收到了这个错误 raise self.exception(method, uri, response, 'Unable to create record') twilio.base.exceptions.TwilioRestException: HTTP 400 error: Unable to create record: The 'To' number +9183xxxxxxxx is not a valid phone number. 这是我的密码 import tw
raise self.exception(method, uri, response, 'Unable to create record')
twilio.base.exceptions.TwilioRestException: HTTP 400 error: Unable to create record: The 'To' number +9183xxxxxxxx is not a valid phone number.
这是我的密码
import twilio
from twilio.rest import Client
def send_sms(msg,mobile):
account_sid = "AC72f9bbb867b24cc2491ef2718269f143"
auth_token = "**REDACTED**"
client = Client(account_sid,auth_token)
sms = client.messages.create(from_ = "+15304276284",body = msg,to = mobile)
print("Sms Sent Successfully sms sid is: ",sms.sid)
send_sms("Hello I am from twilio",+9183xxxxxxxx)
请解决任何问题。尝试从电话号码中删除国家/地区代码。上面说,
收件人号码+9183xxxxxxxx不是有效的电话号码。
阅读有关正确输入电话号码的文档您应该轮换身份验证令牌,因为您已公开共享该令牌。验证令牌以及如何更改它们(旋转凭据)