Skip to Content
Short Message Service(USMS)CreateUSMSTemplate

Apply for USMS Template - CreateUSMSTemplate

Overview

Invoke the CreateUSMSTemplate interface to apply for a USMS template

💡 You can apply for a SMS template by calling the CreateUSMSTemplate interface or through the control panel. The SMS template must comply with the UCloud Service Agreement. For the SMS template application process, please refer to the official website’s SMS Template Review Standards instructions.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateUSMSTemplate.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
ProjectIdstringProject ID, if not filled in, the default project will be used. Sub-accounts must fill in. Please refer to the GetProjectList interface.Yes
PurposeintPurpose of SMS templates: 1- Verification code SMS template; 2- System notification SMS template; 3- Member promotion SMS template;Yes
TemplateNamestringSMS template name, not exceeding 32 characters, each Chinese character, symbol, English letter, number, etc. are counted as one character.Yes
TemplatestringThe content of the SMS template is explained as follows: The number of characters does not exceed 500, each Chinese character, symbol, English letter, number, etc. are counted as one character; The format for filling in variables in the template is: {N}, where N is an integer greater than 1. When there are multiple parameters, it is recommended that N starts from 1 in order, for example: {1}, {2}, etc.; The SMS template prohibits situations that only include variables;Yes
InternationalbooleanIndicates whether it is an international short message. true: international short message, false: domestic short message. If no value is passed, the default value is false.No
RemarkstringReason for SMS template application, the number of characters should not exceed 128. Each Chinese character, symbol, English letter, number, etc. is counted as one character.No
UnsubscribeInfostringWhen Purpose=3 and International=false, i.e., for domestic member promotion SMS templates, this field is required. Enumerated value: 【拒收请回复R】No
InstructionstringTemplate Variable Property DescriptionNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
TemplateIdstringSMS Template ID (Work Order ID when applying for SMS template)Yes

Example

Request Example

https://api.ucloud-global.com/?Action=CreateUSMSTemplate &Region=cn-zj &Zone=cn-zj-01 &ProjectId=nwkzSZQY &Purpose=1 &TemplateName=vnSDFAjK &Template=ulaAspXU &International=true &Remark=eGfxoirr &UnsubscribeInfo=LJlQORyc &Instruction=fotdmkKB

Response Example

{ "Action": "CreateUSMSTemplateResponse", "Message": "iUdpztgk", "RetCode": 0, "TemplateId": "edcONjeS" }