Sends an SMS message to one or more specified mobile numbers.
Operation description
Use this API to send an SMS message to a single mobile number. This API also supports sending messages with the same signature and template variables to multiple mobile numbers, up to 1,000 per request. Note that bulk sending may experience some latency. If you need to send messages with different signatures or template variables to multiple recipients, use the SendBatchSms API, which supports up to 100 mobile numbers per request.
Usage notes
For SMS messages sent to the Chinese mainland, we recommend setting the timeout period to 1 second or longer. If a timeout occurs, check the delivery receipt status before retrying the request. For more information about timeout and retry settings, see Timeout mechanism and Retry mechanism.
This API does not support idempotence for domestic, international, or multimedia SMS messages. You must implement your own idempotence controls to prevent sending duplicate messages during retries.
This is a billable API. For messages sent to the Chinese mainland, billing is based on the delivery receipt status from the carrier. You are not charged if the API call is successful but the carrier fails to deliver the message. For more information, see Billing.
QPS limit
This API has a queries per second (QPS) limit of 5,000 for each user. The system throttles calls that exceed this limit. To avoid throttling, use this API within the specified limit.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dysms:SendSms |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PhoneNumbers |
string |
Yes |
The recipient's mobile number. The format varies based on the destination region:
Note
To send a message to multiple numbers, separate them with commas (,). You can specify up to 1,000 mobile numbers per request. Bulk sending may have higher latency than sending single messages. For time-sensitive messages such as verification codes, we recommend sending them individually. |
1390000**** |
| SignName |
string |
Yes |
The signature name. Call the QuerySmsSignList API or view your list of signatures in the Short Message Service console. You must use a signature that has been approved. Note
|
阿里云 |
| TemplateCode |
string |
Yes |
The code of the template. Call the QuerySmsTemplateList API or view your list of templates in the Short Message Service console. You must use the code of a template that has been approved. |
SMS_15305**** |
| TemplateParam |
string |
No |
The values for the template variables, specified as a JSON string. This parameter is required if the template contains variables. The JSON string must provide a value for each variable. Note
|
{"name":"张三","number":"1390000****"} |
| SmsUpExtendCode |
string |
No |
The upstream SMS extension code. An upstream SMS message is a message sent from a user to a service provider to subscribe to a service, make a query, or perform other tasks. Such messages are charged by the carrier at standard rates. Note
The system assigns a default extension code when a signature is created. Use this parameter to specify a different code. You can ignore this parameter if you do not have special requirements. |
90999 |
| OutId |
string |
No |
The external transaction ID. Note
You can ignore this parameter if you do not have special requirements. |
abcdefgh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| Code |
string |
The request status code.
|
OK |
| Message |
string |
The description of the status code. |
OK |
| BizId |
string |
The delivery receipt ID. Use this ID to query the delivery status by calling the QuerySendDetails API. |
9006197469364984**** |
| RequestId |
string |
The Request ID. |
F655A8D5-B967-440B-8683-DAD6FF8DE990 |
Examples
Success response
JSON format
{
"Code": "OK",
"Message": "OK",
"BizId": "9006197469364984****",
"RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.