Skip to main content

SendBatchUSMSMessage

Call the SendBatchUSMSMessage API to send SMS messages in bulk.

In a single batch request, up to 1000 numbers are supported.

Request Parameters

Parameter nameTypeDescriptionRequired
ActionstringValue: SendBatchUSMSMessage.Yes
AccountIdintAccountId ID Get AccountId.Yes
TaskContent[]TaskCountModalBatch sending content. In the sending content JSON array, each "template" combination is a sub-item, and multiple numbers are supported in each sub-item.Yes

Support sending SMS messages with different contents to multiple different phone numbers in a single request.

TaskCountModal

Parameter nameTypeDescriptionRequired
TemplateIdstringTemplate ID.Yes
Target[]TargetModalSending content specific to the number granularity.Yes
SenderIdstringSMS SenderId.No

TargetModal

Parameter nameTypeDescriptionRequired
PhonestringPhone number.Yes
TemplateParams[]stringThe actual template parameters sent (if using a template without parameters, this parameter cannot be passed).No
SenderIdstringSMS SenderId.No
ExtendCodestringSMS extension code.
UserIdstringCustom business identifier.

Response Elements

Parameter nameTypeDescriptionRequired
RetCodeintWhen RetCode is not 0, the specific error description is displayed in Message. If RetCode is 0, Message will not be returned.Yes
ActionstringOperation name.Yes
MessagestringError description when an error occurs.Yes
SessionNostringThe unique ID of the send task submitted for this session, which can be used to query the list of SMS messages sent during this session. Note: This field is returned only when the number of successfully submitted SMS messages is greater than 0.No
ReqUuidstringThe UUID of this request.No
SuccessCountintThe number of successfully submitted SMS (not split).No
FailContentarrayDetails of unsent messages. This field is valid when the return code is non-zero and can be used to resend based on the data in this field.No

BatchInfo

Parameter nameTypeDescriptionRequired
TemplateIdstringTemplate ID.Yes
SenderIdstringSenderId.Yes
TargetarraySpecific number information.Yes
FailureDetailsstringDetails of unsent messages. Note: This field is valid when the template/SenderId check fails.No

FailPhoneDetail

Parameter nameTypeDescriptionRequired
TemplateParamsarrayTemplate parameters.Yes
PhonestringMobile phone number.Yes
ExtendCodestringExtension number.No
UserIdstringUser-defined ID.No
FailureDetailsstringReason for sending failure. Note: This field will be empty if the template/SenderId check fails.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": [
"23333",
"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"
}