AddSmsTemplate
This operation has been discontinued.
This API has been deprecated. We recommend migrating to Dysmsapi(2017-05-25) - CreateSmsTemplate for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.
Operation description
-
In accordance with the regulations of the Ministry of Industry and Information Technology and carrier requirements, Alibaba Cloud has upgraded the template-related API features. To improve the review efficiency and approval rate of your templates, use the new operation CreateSmsTemplate.
-
You can commit up to 100 SMS template applications per calendar day through the API. Wait at least 30 seconds between submissions. If you apply for SMS templates through the console, there is no limit on the number of submissions.
-
Template information submitted through the API is synchronized with the China Short Message Service (China SMS) console. For related operations on templates in the console, see SMS templates.
-
After you commit a template application, you can call the QuerySmsTemplate operation to query the template review status and details. You can also configure receipt messages and obtain the template review status through TemplateSmsReport.
-
China SMS templates and international/Hong Kong, Macao, and Taiwan SMS templates are not interchangeable. Apply for templates based on your business scenarios.
-
Only users who verify your identity - Enterprise account can apply for promotional SMS messages and international/Hong Kong, Macao, and Taiwan messages. For more information about the differences between individual and enterprise user privileges, see Before you begin.
QPS limit
The single-user QPS limit for this operation is 1,000 calls per second. If this limit is exceeded, the API calls are throttled, which may affect your business. Call this operation as appropriate.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dysms:AddSmsTemplate |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateType |
integer |
Yes |
The SMS type. Valid values:
Note
Only users who verify your identity - Enterprise account can apply for promotional SMS messages and international/Hong Kong, Macao, and Taiwan messages. For details about the differences between individual and enterprise user privileges, see Before you begin. |
0 |
| TemplateName |
string |
Yes |
The template name. The name can be up to 30 characters in length. |
Verification code. |
| TemplateContent |
string |
Yes |
The template content. The content can be up to 500 characters in length. The template content and variable content must comply with the SMS template specifications. Otherwise, the template will fail the review. You can also view common template examples on the Apply for template page. Using example templates can improve the review efficiency and approval rate. For more information about variable specifications, see TemplateContent parameter variable specifications. |
You are applying for mobile registration. The verification code is ${code}, valid for 5 minutes. |
| Remark |
string |
Yes |
The description of the SMS template application. The description can be up to 100 characters in length. The description serves as reference information for template review. A complete description helps reviewers understand your business scenario and improves review efficiency. Guidelines:
|
Apply for verification code SMS. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The request status code.
|
OK |
| Message |
string |
The description of the status code. |
OK |
| RequestId |
string |
The request ID. |
F655A8D5-B967-440B-8683-DAD6FF8DE990 |
| TemplateCode |
string |
The SMS template code. After you submit a template application, you can use the SMS template code to call the QuerySmsTemplate operation to query the template review details. You can also configure receipt messages and obtain the template review status through TemplateSmsReport. |
SMS_46817**** |
Examples
Success response
JSON format
{
"Code": "OK",
"Message": "OK",
"RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990",
"TemplateCode": "SMS_46817****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | TemplateParameterCountIllegal | The verification code template only supports 1 verification code as a variable | Verification code templates support only one variable, which must be a verification code. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.