使用twilio API在python中发送SMS时出错

问题描述

我正在尝试发送短信,但出现此错误

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)

解决任何人。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)