QuerySmsTemplateList

更新时间:
复制 MD 格式

You can call this operation to query all SMS templates under your account and view their details, such as the review status, type, and content.

Operation description

  • This operation queries the details of all templates under your account. To query additional information, such as template variables or uploaded files, you can call the GetSmsTemplate operation to query the review details of a single template by its template code.

  • You can also view the details of all templates under your account on the Template Management page in the Short Message Service console.

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

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PageIndex

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of templates to return on each page. Valid values: 1 to 50. Default value: 10.

10

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. Alibaba Cloud generates a unique ID for each request. You can use this ID to troubleshoot issues.

819BE656-D2E0-4858-8B21-B2E47708****

Code

string

The status code of the request.

  • OK indicates that the request was successful.

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

OK

Message

string

The description of the status code.

OK

SmsTemplateList

array<object>

The list of results.

array<object>

The details of a single template.

TemplateCode

string

The code of the SMS template.

SMS_1525***

TemplateName

string

The name of the SMS template.

验证码模板

OuterTemplateType

integer

The type of the template. This parameter is for external use. Valid values:

  • 0: Captcha message.

  • 1: Notification.

  • 2: Promotional message.

  • 3: International SMS.

0

AuditStatus

string

The review status of the template. Valid values:

  • AUDIT_STATE_INIT: The template is under review.

  • AUDIT_STATE_PASS: The template is approved.

  • AUDIT_STATE_NOT_PASS: The template was rejected. For the reason, see the Reason parameter.

  • AUDIT_SATE_CANCEL: The review is canceled.

AUDIT_STATE_PASS

TemplateContent

string

The content of the template.

验证码为:${code},您正在注册成为平台会员,感谢您的支持!

CreateDate

string

The time when the template was created. The format is yyyy-MM-dd HH:mm:ss.

2020-06-04 11:42:17

Reason

object

The review response.

RejectDate

string

The time when the template was rejected. The format is yyyy-MM-dd HH:mm:ss.

2020-06-04 16:01:17

RejectInfo

string

The reason for the rejection.

变量不符合规范

RejectSubInfo

string

The detailed description of the rejection reason.

变量属性选择错误。 请根据业务使用场景选择合适的变量属性。

OrderId

string

The ticket ID.

Reviewers use this parameter to query review details. Provide this ticket ID to request an expedited review.

2004983****

TemplateType

integer

The type of the template. Valid values:

  • 0: Notification.

  • 1: Promotional message.

  • 2: Captcha message.

  • 6: International SMS.

2

SignatureName

string

The name of the associated signature.

阿里云

TotalCount

integer

The total number of templates returned.

100

CurrentPage

integer

The page number of the returned page. Default value: 1.

1

PageSize

integer

The number of templates returned per page. Valid values: 1 to 50.

10

Examples

Success response

JSON format

{
  "RequestId": "819BE656-D2E0-4858-8B21-B2E47708****",
  "Code": "OK",
  "Message": "OK",
  "SmsTemplateList": [
    {
      "TemplateCode": "SMS_1525***",
      "TemplateName": "验证码模板",
      "OuterTemplateType": 0,
      "AuditStatus": "AUDIT_STATE_PASS",
      "TemplateContent": "验证码为:${code},您正在注册成为平台会员,感谢您的支持!",
      "CreateDate": "2020-06-04 11:42:17",
      "Reason": {
        "RejectDate": "2020-06-04 16:01:17",
        "RejectInfo": "变量不符合规范",
        "RejectSubInfo": "变量属性选择错误。\n请根据业务使用场景选择合适的变量属性。"
      },
      "OrderId": "2004983****",
      "TemplateType": 2,
      "SignatureName": "阿里云"
    }
  ],
  "TotalCount": 100,
  "CurrentPage": 1,
  "PageSize": 10
}

Error codes

See for a complete list.

Release notes

See Release Notes for a complete list.