QuerySmsTemplate

更新时间:
复制 MD 格式

This API has been deprecated.

Note

This API has been deprecated. We recommend migrating to Dysmsapi(2017-05-25) - GetSmsTemplate 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 APIs to comply with regulatory and carrier requirements. We recommend that you use the new GetSmsTemplate - Query template review details API. The new API returns more detailed template information in its response.

  • Review timeline: After you submit a template, Alibaba Cloud typically completes the review within two hours. Review hours are 9:00 to 21:00 (UTC+8) from Monday to Sunday. Reviews are postponed during public holidays. We recommend that you submit your templates before 18:00 (UTC+8).

  • If a template fails review, the response includes the reason for the rejection. For more information, see Suggestions for handling a failed review. You can then call the ModifySmsTemplate API or modify the template on the Template Management page.

  • QuerySmsTemplate queries the review details of a single template by its template code. To query the details of all templates in your account, call the QuerySmsTemplateList API.

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

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TemplateCode

string

Yes

The template code.

SMS_1525***

Response elements

Element

Type

Description

Example

object

The data returned.

TemplateContent

string

The template content.

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

RequestId

string

The request ID.

0A974B78-02BF-4C79-ADF3-90CFBA1B55B1

TemplateCode

string

The template code.

SMS_16703****

TemplateStatus

integer

The review status of the template. Valid values:

1

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

TemplateType

integer

The message type. Valid values:

  • 0: Verification code.

  • 1: Message notification.

  • 2: Promotional message.

  • 3: International message.

1

Message

string

The description of the status code.

OK

TemplateName

string

The template name.

aliyun verification code

CreateDate

string

The time when the template was created.

2019-06-04 11:42:17

Reason

string

The review notes for the template.

  • If the review status is Approved or Reviewing, the message "No review remarks" is returned.

  • If the review status is Rejected, the reason for the rejection is returned.

The document cannot verify the authenticity of the information. Please upload it again.

Examples

Success response

JSON format

{
  "TemplateContent": "You are applying for mobile registration. The verification code is: ${code}, valid for 5 minutes!",
  "RequestId": "0A974B78-02BF-4C79-ADF3-90CFBA1B55B1",
  "TemplateCode": "SMS_16703****",
  "TemplateStatus": 1,
  "Code": "OK",
  "TemplateType": 1,
  "Message": "OK",
  "TemplateName": "aliyun verification code",
  "CreateDate": "2019-06-04 11:42:17",
  "Reason": "The document cannot verify the authenticity of the information. Please upload it again."
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.