CreateCardSmsTemplate

更新时间:
复制 MD 格式

Creates a card SMS template.

Operation description

  • The card SMS feature is currently available by invitation only. To enable this feature, contact your Alibaba Cloud business manager or our pre-sales consultation team.

  • This operation saves a card SMS template, submits it to mobile phone vendors for review, and returns a template code.

  • If a card SMS template contains a type or event that a vendor does not support, the system does not submit the template to that vendor for review. For more information, see Supported template types by vendor.

  • For more examples of card SMS templates, see Card SMS template examples.

QPS limit

The QPS limit for a single user is 300. API calls that exceed this limit are throttled, which may impact your business. Plan your calls accordingly.

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

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TemplateName

string

Yes

The name of the card SMS template.

阿里云图文类模板

Template

object

Yes

The content of the card SMS template.

Note

{ "extendInfo":{ "scene":"HMOVM图文", "purpose":"2", "userExt":{ "outId":"1234554321" } }, "templateContent":{ "pages":[ { "tmpCards":[ { "type":"IMAGE", "srcType":1, "src":"28755", "actionType":"OPEN_APP", "action":{ "target":"https://s.tb.cn/c.KxzZ", "merchantName":"测试-图文模板", "packageName":[ "com.taobao.taobao"], "floorUrl":"https://s.tb.cn/c.KxzZ" }, "positionNumber":1 }, { "type":"TEXT", "content":"测试- BENZ AMG 2020 试驾邀请", "isTextTitle":true, "positionNumber":2 }, { "type":"TEXT", "content":"测试-梅赛德斯-奔驰,创新激情永不灭。作为汽车 XXXX", "isTextTitle":false, "positionNumber":3 }, { "type":"BUTTON", "content":"预约试驾", "actionType":"OPEN_BROWSER", "action":{ "target":"https://www.mercedes-benz.com.cn", "merchantName":"测试-正在跳转梅赛德斯-奔驰" }, "positionNumber":4 }] }] }, "cardSignName":"阿里云", "cardType":5, "companyName": "投放企业名称" }

Memo

string

No

A description of the template.

图文类模板

Factorys

string

No

The vendors to which the template will be submitted. Valid values:

  • HuaWei: Huawei

  • XiaoMi: Xiaomi

  • OPPO: OPPO

  • VIVO: VIVO

  • MEIZU: MEIZU

  • HONOR: HONOR

Note

If you do not specify this parameter, the system automatically submits the template to all supported mobile phone vendors.

["HuaWei","XiaoMi"]

Response elements

Element

Type

Description

Example

object

The data object.

Code

string

The request status code. Valid values:

  • OK: The request was successful.

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

OK

RequestId

string

The request ID.

F655A8D5-B967-440B-8683-DAD6FF8DE990

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

Data

object

The data returned by the operation.

TemplateCode

string

The code for the card SMS template. You can view the Template Code on the Card SMS > template management page in the console.

Note

The card SMS template must be approved before it can be used.

CARD_SMS_2****

Examples

Success response

JSON format

{
  "Code": "OK",
  "RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990",
  "Success": true,
  "Data": {
    "TemplateCode": "CARD_SMS_2****"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

200 ForbiddenAction Access to the account is denied. Please contact the administrator. No access, please contact administrator.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.