跳到主要内容

SendBatchUSMSMessage

调用SendBatchUSMSMessage接口批量发送短信

在一次批量请求中,最多支持1000个号码

Request Parameters

Parameter nameTypeDescriptionRequired
Actionstring值为:SendBatchUSMSMessageYes
AccountIdint项目ID: 获取AccountIdYes
TaskContent[]TaskCountModal批量发送内容,发送内容json数组中,每个“模板”组合作为一个子项,每个子项内支持多个号码Yes

支持在一次请求中向多个不同的手机号码发送不同内容的短消息

TaskCountModal

Parameter nameTypeDescriptionRequired
TemplateIdstring模版IDYes
Target[]TargetModal具体到号码粒度的发送内容Yes
SenderIdstring短信SenderIdNo

TargetModal

Parameter nameTypeDescriptionRequired
Phonestring手机号码Yes
TemplateParams[]string实际发送的模板参数(若使用的是无参数模板,该参数不能传值)No
SenderIdstring短信SenderIdNo
ExtendCodestring短信扩展码
UserIdstring自定义业务标识

Response Elements

Parameter nameTypeDescriptionRequired
RetCodeint当RetCode不为0时,Message中显示具体错误描述,若RetCode为0,不返回MessageYes
Actionstring操作名称Yes
Messagestring发生错误时表示错误描述Yes
SessionNostring本次提交发送任务的唯一ID,可根据该值查询本次发送的短信列表。注:成功提交短信数大于0时,才返回该字段No
ReqUuidstring本次请求UuidNo
SuccessCountint成功提交短信(未拆分)条数No
FailContentarray未发送成功的详情,返回码非0时该字段有效,可根据该字段数据重发No

BatchInfo

Parameter nameTypeDescriptionRequired
TemplateIdstring模板IDYes
SenderIdstringSenderIdYes
Targetarray具体号码信息Yes
FailureDetailsstring未能成功发送的详情。注:模板/SenderId检验失败时,该字段有效No

FailPhoneDetail

Parameter nameTypeDescriptionRequired
TemplateParamsarray模板参数Yes
Phonestring手机号Yes
ExtendCodestring扩展号码No
UserIdstring用户自定义IDNo
FailureDetailsstring发送失败原因。注:若模板/SenderId校验失败,该字段为空No

Request Example

curl -X POST https://api.uspeedo.com/api -H 'Content-Type: application/json' -d '{
"Action": "SendBatchUSMSMessage",
"AccountId": 1,
"TaskContent": [
{
"TemplateId": "UTA20212831C85C",
"SenderId": "uSpeedo",
"Target": [
{
"TemplateParams": [
"123456"
],
"Phone": "(852)55311111",
"ExtendCode": "123",
"UserId": "456"
}
]
}
]
}'

Response Example

{
"FailContent": [
{
"SenderId": "UCloud",
"Target": [
{
"Phone": "(852)55311111",
"UserId": "catch the big fish",
"ExtendCode": "123",
"TemplateParams": [
"开心果挖土机",
"13579"
]
}
],
"FailureDetails": "phone in the black list",
"TemplateId": "UTA20212831C85C"
}
],
"RetCode": 0,
"SuccessCount": 2,
"SessionNo": "abcd-dadd-dafs-dadfa-dafdsa",
"Action": "SendBatchUSMSMessageResponse",
"Message": "submit success",
"ReqUuid": "abcd-dadd-dafs-dadfa-dafdsa"
}