Send Batch SMS
API Description
Send SMS messages in batch. Supports sending to multiple phone numbers at once.
Request Information
- Get API Key:
ACCESSKEY_ID:ACCESSKEY_SECRET - Request Method:
POST - Request Path:
/api/v1/usms/SendBatchUSMSMessage - Content-Type:
application/json
Notes:
- Up to 1000 phone numbers (summed over all
Targetarrays) in a single request. SessionNoin the response is one UUID string that identifies the whole batch — not an array. Each number in the batch shares the sameSessionNo.
AccountIdint
Project ID the template belongs to. Optional — if omitted, the default project of the current API key is used. If the template belongs to a non-default project, you must pass that project's AccountId, otherwise the request fails with "Invalid Template". The API key must have access to this project.
?
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 Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| AccountId | int | No | Project ID the template belongs to. Omit to use the default project of the current API key. Required when the template belongs to a non-default project. | 60000001 |
| TaskContent | array | Yes | Send task list | See description below |
TaskContent Array Element Description
Each element contains the following fields:
| Parameter Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| TemplateId | string | Yes | Template ID | "template_id_1" |
| SenderId | string | No | Sender identifier (sender name), at most 11 characters. Defaults to Uinter when omitted or empty. Must not contain Chinese characters | "uSpeedo" |
| Target | array | Yes | Target phone number list | See description below |
Target Array Element Description
Each element contains the following fields:
| Parameter Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| Phone | string | Yes | Phone number | "13800138000" |
| TemplateParams | array | No | Template parameters (according to template variables) | ["123456"] |
| ExtendCode | string | No | SMS extension code, at most 32 characters | "123" |
| UserId | string | No | Your own business identifier for this number, at most 32 characters | "456" |
Response Format
Success Response
{
"Action": "SendBatchUSMSMessageResponse",
"RetCode": 0,
"Message": "Send success",
"ReqUuid": "cbfaf1a2-9d12-4f8a-81c7-56f67ba708ea",
"SessionNo": "550e8400-e29b-41d4-a716-446655440000",
"SuccessCount": 2
}
Partial Success Response
If some numbers failed while others were submitted successfully, RetCode is 18046 and the failed items are returned in FailContent. The same 18046 is returned when every number failed (SuccessCount is 0 and SessionNo is absent) — inspect FailContent to see the reasons:
{
"Action": "SendBatchUSMSMessageResponse",
"RetCode": 18046,
"Message": "USMS Batch Send Partial Success, Number of successfully sent is 1",
"ReqUuid": "cbfaf1a2-9d12-4f8a-81c7-56f67ba708ea",
"SessionNo": "550e8400-e29b-41d4-a716-446655440000",
"SuccessCount": 1,
"FailContent": [
{
"TemplateId": "template_id_1",
"SenderId": "uSpeedo",
"Target": [
{
"Phone": "13800138001",
"TemplateParams": ["123456"],
"FailureDetails": "Invalid phone number [13800138001]",
"Invalid": true
}
]
}
]
}
Response Field Description
| Field Name | Type | Description |
|---|---|---|
| Action | string | Fixed value SendBatchUSMSMessageResponse |
| RetCode | int | Return code, 0 indicates success, 18046 indicates partial success |
| Message | string | Return message |
| ReqUuid | string | Request UUID, useful when reporting issues |
| SessionNo | string | A single session number (UUID) for this batch. Returned only when at least one message was submitted successfully. Use it to query send status via Get SMS Send Status |
| SuccessCount | int | Number of phone numbers submitted successfully (before splitting into segments) |
| FailContent | array | Failure details. Present only when RetCode is 18046. Each element describes one TaskContent entry that had failures |
FailContent Element Description
| Field Name | Type | Description |
|---|---|---|
| TemplateId | string | Template ID of the failed task |
| SenderId | string | Sender identifier of the failed task |
| Target | array | Failed phone numbers, see below |
| FailureDetails | string | Failure reason for the whole task (e.g. invalid template / sender). When set, the per-number FailureDetails may be empty |
FailContent Target Element Description
| Field Name | Type | Description |
|---|---|---|
| Phone | string | Phone number |
| TemplateParams | array | Template parameters |
| ExtendCode | string | SMS extension code, if provided in the request |
| UserId | string | Your business identifier, if provided in the request |
| FailureDetails | string | Failure reason for this number, e.g. Invalid phone number [...], Quota is not enough in area [...], Invalid Template para numbers (should be N) |
| Invalid | bool | Always true for returned failure items |
Error Response
{
"Action": "SendBatchUSMSMessageResponse",
"RetCode": 18001,
"Message": "Missing parameter [TaskContent]",
"ReqUuid": "cbfaf1a2-9d12-4f8a-81c7-56f67ba708ea"
}
Common Error Codes
| Error Code | Description |
|---|---|
| 0 | Success |
| 18001 | Missing required parameter |
| 18003 | Parameter format error |
| 18019 | Too many phone numbers (more than 1000 in one request) |
| 18046 | Partial success (some numbers failed, see FailContent) |
| 215392 | Parameter error (gateway) |
| 215397 | Missing required parameter (gateway) |
| 215400 | Server error (gateway) |
LANGUAGE
CREDENTIALS
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.