为什么遭受丑陋和有限的网址?您可以使用现代且方便的our JSON REST API . 由于您已经通过curl library使用了http请求,因此使用我们为批量短信请求提供的两个选项之一是没有问题的(例如,参见this answer):
完整表格
当您描述要发送的每条消息时,所有遗漏的内容都将从模板中获取:
POST /sms/v1/{subAccountId}/many
{
"clientBatchId": "Demo#1001",
"messages": [
{
"destination": "6598760001"
},
{
"destination": "659876002",
"source": "SenderId2",
"clientMessageId": "id_100001"
},
{
"destination": "509750003",
"country": "FR",
"source": "SenderId3",
"text": "Custom message: สวัสดี",
"encoding": "UCS2",
"clientMessageId": "id_100002"
}
],
"template": {
"source": "DefaultSenderId",
"text": "Default message for all phone numbers"
}
}
紧凑形式
当您只列举电话号码时,其他所有内容都来自模板:
POST /sms/v1/{subAccountId}/many/compact
{
"destinations": [
"6598760000",
"+659870001",
"tel+659870002",
"+33(509)758-000"
],
"template": {
"source": "BRAND",
"text": "Your message for all clients"
}
}
查看此tutorial以更顺利地深入了解API .