UpdateSmsTemplate

更新时间:
复制 MD 格式

This API modifies a template that failed review and automatically resubmits it.

Operation description

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

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 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:

  • 0: verification code.

  • 1: SMS notification.

  • 2: promotional SMS.

  • 3: international/regional message.

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 TemplateType is set to 2 (promotional SMS), you must upload proof of user authorization. For more information, see Upload specifications for user authorization materials.

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.

  • If the associated SMS signature's business scenario is "Live App", the ApplySceneContent parameter must be an app URL starting with http:// or https://.

  • The ApplySceneContent parameter is required if the associated SMS signature's business scenario is "Registered Trademark" or "Name of Enterprise or Public Institution".

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

  • 1: promotional SMS.

  • 2: verification code.

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

  • If the content is not a variable, do not pass the variableName field.

  • If the name of the enterprise or public institution is different from that in the SMS signature qualification, provide the companyDifferentFromSignQuaReason field.

  • If trafficDrivingType is set to DOMAIN, you must provide all the fields.

  • For trafficDrivingType values other than DOMAIN, the trafficDrivingType, trafficDrivingContent, companyName, and organizationCode fields are required. The variableName and companyDifferentFromSignQuaReason fields are optional.

3. TrafficDrivingType enumeration

Warning Due to regulatory requirements, mobile numbers are not supported.
  • DOMAIN: A domain name.

  • FIXED_PHONE: A fixed-line phone number.

  • 400_PHONE: A phone number that starts with 400.

  • 800_PHONE: A phone number that starts with 800.

  • 95_PHONE: A phone number that starts with 95.

  • 96_PHONE: A phone number that starts with 96.

  • 1_PHONE: A 3-digit to 8-digit phone number that starts with 1.

  • OTHER_PHONE: Another type of phone number.

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

  • 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 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.