This API modifies a template that failed review and automatically resubmits it.
Operation description
-
For details about the changes to the signature and template APIs, see Announcement on Updating Signature & Template APIs for Short Message Service.
-
You can only modify templates that have failed review. For troubleshooting, see Suggestions for handling failed SMS template reviews. After modifying a template with this API, you must resubmit it for review.
-
Template changes made using this API are synchronized with the Short Message Service console. To learn more about managing templates in the console, see SMS templates.
QPS limit
The QPS limit for this API is 1,000 queries per second per user. If you exceed this limit, your API calls will be throttled. This can affect your business, so please use the API responsibly.
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 name of the SMS template, up to 30 characters long. You can find the names of rejected templates on the Messages in Chinese Mainland > Template Management tab in the console or by calling the QuerySmsTemplateList operation. |
验证码模板 |
| TemplateCode |
string |
Yes |
The code of the rejected SMS template. You can find the template code on the Messages in Chinese Mainland > Template Management tab in the console or by calling the QuerySmsTemplateList operation. |
SMS_152550**** |
| TemplateContent |
string |
Yes |
The new template content, up to 500 characters long. The template content and its variables must comply with SMS template specifications to be approved. To increase the approval rate and efficiency, refer to the common examples on the Apply for Template page. For more information about variable specifications, see TemplateContent parameter variable specifications. |
您正在申请手机注册,验证码为:${code},5分钟内有效! |
| Remark |
string |
No |
Describe your business scenario, including a URL if applicable. You must also provide a complete SMS message example with populated variables. Providing this information as required is critical for template approval. |
登录场景使用验证码 |
| TemplateType |
integer |
Yes |
The SMS type. Valid values:
Note
Only enterprise-verified users can apply for promotional SMS and international/regional messages. For more information about the differences between personal and enterprise accounts, see Usage notes. |
0 |
| RelatedSignName |
string |
No |
The SMS signature associated with the template. |
阿里云 |
| TemplateRule |
string |
No |
The rules for the variables in the template. For details on how to define these rules, see the example document. |
{"code":"characterWithNumber"} |
| MoreData |
array |
No |
Additional materials, such as supporting documents or business screenshots, to help reviewers understand your business. If |
|
|
string |
No |
The OSS key of the uploaded file. For instructions on how to upload files, see Upload files to OSS. |
10098689758****/1234qwe.png |
|
| ApplySceneContent |
string |
No |
The business scenario.
|
http://www.aliyun.com/ |
| IntlType |
integer |
No |
The type of the international/regional template. This parameter is required when the TemplateType parameter is set to 3. Valid values:
|
0 |
| TrafficDriving |
string |
No |
Warning
To manage SMS content security, messages that contain traffic-driving information such as phone numbers and URLs may be blocked by carriers, which can cause delivery failures. We recommend that you avoid including such information in your SMS templates to prevent delivery failures. A JSON string that contains a list of traffic-driving information. Important The value must be in the JSON format. Convert the value to a string before you pass it in. 1. Fields{ "trafficDrivingType":"Traffic-driving type", "trafficDrivingContent":"Traffic-driving content", "variableName":"variable name", "companyName":"Name of the enterprise or public institution", "organizationCode":"Unified Social Credit Code", "icpNo":"ICP filing/permit number", "icpPicOssKey":"OSS key of the ICP filing screenshot", "companyDifferentFromSignQuaReason":"The reason why the name of the enterprise or public institution is different from that in the SMS signature qualification" } 2. Notes
3. TrafficDrivingType enumerationWarning Due to regulatory requirements, mobile numbers are not supported.
|
[{"trafficDrivingType":"DOMAIN","trafficDrivingContent":"aliyun.com","companyName":"阿里云计算有限公司","organizationCode":"91330****73959654P","icpNo":"浙B2-20****01-4","icpPicOssKey":"db7784d8-cb0c-498f-****-295f1ad6d665_mf29l7nf.png","companyDifferentFromSignQuaReason":"这是一段说明文字"},{"trafficDrivingType":"1_PHONE","trafficDrivingContent":"1**86","variableName":"my1Phone","companyName":"阿里云计算有限公司","organizationCode":"91330****73959654P","companyDifferentFromSignQuaReason":"这是一段说明文字"}] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The unique identifier of the request, generated by Alibaba Cloud. Use this request ID to troubleshoot issues. |
819BE656-D2E0-4858-8B21-B2E477085AA0 |
| Code |
string |
The status code of the request. Valid values:
|
OK |
| Message |
string |
The description of the status code. |
OK |
| TemplateName |
string |
The name of the SMS template. |
验证码 |
| TemplateCode |
string |
The template code. After you submit a modified template for review, you can use the template code to call the GetSmsTemplate operation and query the review details. You can also configure delivery receipts to receive the review status in a TemplateSmsReport message. |
SMS_152550**** |
| OrderId |
string |
The order ID. Reviewers use this ID to query the review status. Provide this order ID if you request an expedited review. |
20041271**** |
Examples
Success response
JSON format
{
"RequestId": "819BE656-D2E0-4858-8B21-B2E477085AA0",
"Code": "OK",
"Message": "OK",
"TemplateName": "验证码",
"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.