Skip to main content

Send Batch SMS

API Description

Send SMS messages in batch. Supports sending to multiple phone numbers at once.

Request Information

TaskContentarrayrequired
Use the form list to add each send task. The component will assemble it into the TaskContent JSON structure automatically.
TaskContent Preview
This JSON will be assembled into the request body.
[
  {
    "TemplateId": "template_id_1",
    "SenderId": "uSpeedo",
    "Target": [
      {
        "Phone": "13800138000",
        "TemplateParams": [
          "123456"
        ]
      }
    ]
  }
]
Task 1

Body Parameters

Parameter NameTypeRequiredDescriptionExample Value
TaskContentarrayYesSend task listSee description below

TaskContent Array Element Description

Each element contains the following fields:

Parameter NameTypeRequiredDescriptionExample Value
TemplateIdstringYesTemplate ID"template_id_1"
SenderIdstringYesSender identifier (sender name)"uSpeedo"
TargetarrayYesTarget phone number listSee description below

Target Array Element Description

Each element contains the following fields:

Parameter NameTypeRequiredDescriptionExample Value
PhonestringYesPhone number"13800138000"
TemplateParamsarrayNoTemplate parameters (according to template variables)["123456"]

Response Format

Success Response

{
"RetCode": 0,
"Message": "success",
"SessionNo": ["session_no_1", "session_no_2"],
"FailedTargetPhones": []
}

Response Field Description

Field NameTypeDescription
RetCodeintReturn code, 0 indicates success
MessagestringReturn message
SessionNoarraySession number list, used for querying send status
FailedTargetPhonesarrayList of failed phone numbers, each element contains: Phone, TemplateParams, FailureReason

Error Response

{
"RetCode": 215392,
"Message": "Invalid parameter [TemplateId]"
}

Common Error Codes

Error CodeDescription
0Success
215392Parameter error
215397Missing required parameter
215400Server error

LANGUAGE

CREDENTIALS

👁️
🔒
🔑Log in to get ACCESSKEY_ID and ACCESSKEY_SECRET

URL

POST
CURL Request
curl -X POST "https://api.uspeedo.com/api/v1/usms/SendBatchUSMSMessage" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Basic $(echo -n 'ACCESSKEY_ID:ACCESSKEY_SECRET' | base64)" \
-d '{
"TaskContent": [
{
"TemplateId": "template_id_1",
"SenderId": "uSpeedo",
"Target": [
{
"Phone": "13800138000",
"TemplateParams": [
"123456"
]
}
]
}
]
}'

RESPONSE

Click Try It! to start a request and see the response here.