我可以使用curl(bash)和python方法并通过以下代码将消息成功发送到我的whatsapp:https://www.twilio.com/console/sms/whatsapp/learn
但是,如果我将标准模板正文URL从yummycupcakes.com更改为私有IP(10.0.0.x),则消息失败。日志显示:
错误:63030通道类型消息不支持的参数
描述:通道消息类型不支持的参数
确实是在尝试解析我的邮件正文中的链接,并在无法解析的情况下拒绝发送该邮件吗?如果是这样,则非常严格。尚不清楚这是twilio限制还是whatsapp ...
有人在这里有想法吗?示例代码:
from twilio.rest import Client
account_sid = '<my_sid>'
auth_token = '<my_authtoken>'
client = Client(account_sid, auth_token)
message = client.messages.create(
from_='whatsapp:+<my#>',
body='Your Yummy Cupcakes Company order of 1 dozen frosted cupcakes has shipped and should be delivered on July 10, 2019. Details: http://www.yummycupcakes.com/',
to='whatsapp:+<my#>'
)
print(message.sid)
我运行了这段代码,但没有收到您遇到的错误。它只是不会将其呈现为可点击的URL。让我知道我们的代码是否有所不同。
client = Client(account_sid, auth_token)
message = client.messages.create(
from_='whatsapp:+number',
body='Your Yummy Cupcakes Company order of 1 dozen frosted cupcakes has shipped and should be delivered on July 10, 2019. Details: http://{}'.format("10.0.0.22"),
to='whatsapp:+number'
)
print(message.sid)