UpdateSmsTemplate

Updated at:

Modifies an SMS template that failed the review. The modified template is automatically submitted for review after this operation is called.

Operation description

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  • 0: Verification code.

  • 1: SMS notification.

  • 2: Promotional SMS.

  • 3: International or Chinese Hong Kong, Chinese Macao, or Chinese Taiwan message.

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 :

    verification code.

  • 1 :

    SMS notification.

  • 2 :

    promotional SMS.

  • 3 :

    international or Chinese Hong Kong, Chinese Macao, or Chinese Taiwan message.

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.

  • If the scenario of the SMS signature associated with the template is "Online APP", ApplySceneContent must be an app link that starts with http:// or https://.

  • If the scenario of the SMS signature associated with the template is "Registered trademark name" or "Enterprise or public institution name", ApplySceneContent is required.

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: SMS notification.

  • 1: Promotional SMS.

  • 2: Verification code.

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:

  • If the value is not a variable, do not pass in variableName.

  • If the enterprise or public institution name differs from the enterprise or public institution name in the signature qualification, pass in companyDifferentFromSignQuaReason.

  • If trafficDrivingType=DOMAIN, pass in all parameters.

  • If trafficDrivingType is set to other values, pass in trafficDrivingType, trafficDrivingContent, variableName (as needed), companyName, organizationCode, and companyDifferentFromSignQuaReason (as needed).

3. Enumeration values for trafficDrivingType:

Warning Due to regulatory requirements, mobile phone numbers are not supported.
  • DOMAIN: Domain name link.

  • FIXED_PHONE: Landline phone number.

  • 400_PHONE: Phone number starting with 400.

  • 800_PHONE: Phone number starting with 800.

  • 95_PHONE: Phone number starting with 95.

  • 96_PHONE: Phone number starting with 96.

  • 1_PHONE: Phone number starting with 1, 3 to 8 digits.

  • OTHER_PHONE: Other phone numbers.

[{"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: The request was successful.

  • For other error codes, see the Error codes section of this topic or the product API error codes.

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.