ModifySmsTemplate

更新时间:
复制 MD 格式

This API operation is unpublished.

Note

This API has been deprecated. We recommend migrating to Dysmsapi(2017-05-25) - UpdateSmsTemplate for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Operation description

  • Alibaba Cloud has updated its template-related API operations to comply with regulations from the Ministry of Industry and Information Technology (MIIT) and requirements from carriers. To improve the efficiency and success rate of template reviews, use the new UpdateSmsTemplate - Modify an SMS template API operation.

  • You can modify only templates that have failed review. For more information, see Suggestions for handling failed SMS template reviews. After you modify a template by calling this API operation, submit it for review again.

  • When you modify templates using this API operation, the modifications are synchronized to the Short Message Service console. For more information about template operations in the console, see SMS templates.

QPS limits

The queries per second (QPS) limit for a single user is 1,000. If you exceed this limit, API calls are throttled, which can affect your business. Call this operation a reasonable number of times.

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

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TemplateType

integer

Yes

The type of the text message. Valid values:

  • 0: Captcha.

  • 1: Notification.

  • 2: Promotional message.

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

1

TemplateName

string

Yes

The name of the template. The name must be 1 to 30 characters in length.

aliyun verification code

TemplateCode

string

Yes

The code of the SMS template that failed review.

SMS_15255****

TemplateContent

string

Yes

The content of the template. The content can be up to 500 characters in length.

The template content and variables must comply with the SMS template specifications. Otherwise, the template fails the review. You can also view common sample templates on the Apply for Template page. Using sample templates can improve the efficiency and success rate of reviews. For more information about variable specifications, see Variable specifications for the TemplateContent parameter.

You are applying for mobile registration. The verification code is: ${code}, valid for 5 minutes!

Remark

string

Yes

The description for the SMS template application. The description can be up to 100 characters in length.

This information is used for template review. A detailed description helps reviewers understand your business scenario and improves review efficiency. Follow these guidelines:

  • Provide the use case of your online business.

  • Provide a sample text message from a real-world scenario that reflects your business case.

  • Provide the content passed for variables. Describe the business scenario and the reason for choosing this variable property in detail.

  • Provide links to your business website, the domain name with an ICP filing, or the download link for your application in an app marketplace.

  • For logon scenarios, provide a test account and password.

Modify the parameters of the template.

Response elements

Element

Type

Description

Example

object

Code

string

The request status code.

  • A value of OK indicates that the request is successful.

  • For a list of other error codes, see Error codes.

OK

Message

string

The description of the status code.

OK

RequestId

string

The request ID.

F655A8D5-B967-440B-8683-DAD6FF8DE990

TemplateCode

string

The code of the modified template.

SMS_15255****

Examples

Success response

JSON format

{
  "Code": "OK",
  "Message": "OK",
  "RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990",
  "TemplateCode": "SMS_15255****"
}

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 for a complete list.

Release notes

See Release Notes for a complete list.