UpdateSmsTemplate
Modifies an SMS template that failed the review. The modified template is automatically submitted for review after this operation is called.
Operation description
-
For details about the changes between the new and original operations, see Announcement on updating signature and Related operations for Short Message Service.
-
Only templates that failed the review can be modified. Refer to Suggestions for handling SMS review failures, modify the template by calling this operation, and resubmit it for review.
-
Template modifications made through this operation are synchronized to the Short Message Service console. For console-based Related operations, see SMS templates.
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:UpdateSmsTemplate |
none |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateName |
string |
Yes |
The template name. The name can be up to 30 characters in length. You can view the names of templates that failed the review on the China Mainland Messages > Template Management tab in the console. You can also call the QuerySmsTemplateList operation to query the names of SMS templates that failed the review. |
Verification code template |
| TemplateCode |
string |
Yes |
The code of the template that failed the review. You can view the codes of templates that failed the review on the China Mainland Messages > Template Management tab in the console. You can also call the QuerySmsTemplateList operation to query the codes of templates that failed the review. |
SMS_152550**** |
| 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 success rate. For variable specifications, see TemplateContent parameter variable specifications. |
You are applying for mobile registration. The verification code is ${code}, valid for 5 minutes! |
| Remark |
string |
No |
Describe the business scenario in which you use SMS or provide an online link to the business scenario. Provide a complete SMS example with variable content filled in. Complete information helps improve the template review pass rate. If you do not fill in the information as required or leave it empty, the template review may be affected. |
Verification code for login scenario |
| TemplateType |
integer |
Yes |
The SMS type. Valid values:
Note
Only enterprise-authenticated users can apply for promotional SMS and international or Chinese Hong Kong, Chinese Macao, or Chinese Taiwan messages. For details about the differences between individual and enterprise user privileges, see Usage notes. Valid values:
|
0 |
| RelatedSignName |
string |
No |
The SMS signature associated with the template application. |
Alibaba Cloud |
| TemplateRule |
string |
No |
The template variable rules. For information about how to fill in variable rules, see the example documentation. |
{"code":"characterWithNumber"} |
| MoreData |
array |
No |
Additional materials. You can upload supplementary business proof files or business screenshots to help reviewers understand your business details. If the SMS template you are applying for is a promotional SMS (TemplateType is 2), upload user authorization proof materials. For details, see User authorization proof material upload specifications. |
|
|
string |
No |
The file information uploaded to OSS. For file upload operations, see Upload files to OSS. |
10098689758****/1234qwe.png |
|
| ApplySceneContent |
string |
No |
The business scenario.
|
http://www.aliyun.com/ |
| IntlType |
integer |
No |
The international or Chinese Hong Kong, Chinese Macao, or Chinese Taiwan template type. When the TemplateType parameter is set to 3, set this parameter for international or Chinese Hong Kong, Chinese Macao, or Chinese Taiwan templates. Valid values:
|
0 |
| TrafficDriving |
string |
No |
Warning
To manage SMS content security, SMS content that contains traffic-driving information such as phone numbers and links may be blocked by carriers, resulting in delivery failures. Avoid including such information in SMS templates to reduce the risk of delivery failures. The JSON string of the traffic-driving information list. Important The value is in JSON format. Convert it to a string before passing it in. 1. Field description:{ "trafficDrivingType":"Traffic-driving type", "trafficDrivingContent":"Traffic-driving content", "variableName":"Variable name", "companyName":"Enterprise or public institution name", "organizationCode":"Unified social credit code", "icpNo":"ICP filing/license number", "icpPicOssKey":"ICP filing screenshot OssKey", "companyDifferentFromSignQuaReason":"Reason why the enterprise or public institution name differs from the signature qualification" } 2. Precautions:
3. Enumeration values for trafficDrivingType:Warning Due to regulatory requirements, mobile phone numbers are not supported.
|
[{"trafficDrivingType":"DOMAIN","trafficDrivingContent":"aliyun.com","companyName":"Alibaba Cloud Computing Co., Ltd.","organizationCode":"91330****73959654P","icpNo":"ZheB2-20****01-4","icpPicOssKey":"db7784d8-cb0c-498f-****-295f1ad6d665_mf29l7nf.png","companyDifferentFromSignQuaReason":"This is an explanatory note"},{"trafficDrivingType":"1_PHONE","trafficDrivingContent":"1**86","variableName":"my1Phone","companyName":"Alibaba Cloud Computing Co., Ltd.","organizationCode":"91330****73959654P","companyDifferentFromSignQuaReason":"This is an explanatory note"}] |
| SaleSkuCode |
string |
No |
The Short Message Service specification code. Only verification code type templates support selecting an SMS service specification. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. It is a unique identifier generated by Alibaba Cloud for the request and can be used to troubleshoot issues. |
819BE656-D2E0-4858-8B21-B2E477085AA0 |
| Code |
string |
The request status code. Valid values:
|
OK |
| Message |
string |
The description of the status code. |
OK |
| TemplateName |
string |
The SMS template name. |
Verification code |
| TemplateCode |
string |
The SMS template code. After you submit the template modification, you can use the SMS template code to call the GetSmsTemplate operation to query the template review details. You can also configure delivery receipts and use TemplateSmsReport to obtain the template review status message. |
SMS_152550**** |
| OrderId |
string |
The ticket number. Reviewers use this parameter when querying reviews. Provide this ticket number if you need to expedite the review. |
20041271**** |
Examples
Success response
JSON format
{
"RequestId": "819BE656-D2E0-4858-8B21-B2E477085AA0",
"Code": "OK",
"Message": "OK",
"TemplateName": "Verification code",
"TemplateCode": "SMS_152550****",
"OrderId": "20041271****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ForbiddenAction | Access to the account is denied. Please contact the administrator. | |
| 400 | AssocSignUnapproved | Associated signature must be approved. | The associated signature needs to use the approved signature. |
| 400 | InvalidTemplateRule | The template variable format is non-standard. Please refer to the variable format specifications in the help documentation. | The template variable does not meet the specifications. Please check the SMS template specification document and pass in the template variable that meets the requirements. |
| 400 | InvalidTemplateRule.Format | The parameter TemplateRule format must be JSON. | Template variable rules must be filled with JSON-formatted data. |
| 400 | InvalidMoreData | Specified parameter MoreData is not valid. | The uploaded more information is invalid. |
| 400 | TemplateVarLimitExceeded | The verification code template only supports one variable. | The verification code template only supports one variable. |
| 400 | InvalidTemplateContent.Format | Invalid template content format. | The template content is not in the correct format. |
| 400 | ServiceNotOpened | This product service is not opened. | Product service not activated |
| 404 | MissingTemplateName | The template name cannot be empty. | Template name cannot be empty. |
| 404 | SmsSignatureNotFound | The associated SMS signature does not exist. | The associated SMS signature does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.