# 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](https://docs.ucloud.cn/management_monitor/usms/introduction/service_level). For the SMS template application process, please refer to the official website's [SMS Template Review Standards](https://docs.ucloud.cn/management_monitor/usms/introduction/2005/2103) instructions.




## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUSMSTemplate`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID, if not filled in, the default project will be used. Sub-accounts must fill in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |**Yes**|
| **Purpose** | int | Purpose of SMS templates: 1- Verification code SMS template; 2- System notification SMS template; 3- Member promotion SMS template; |**Yes**|
| **TemplateName** | string | SMS template name, not exceeding 32 characters, each Chinese character, symbol, English letter, number, etc. are counted as one character. |**Yes**|
| **Template** | string | The 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**|
| **International** | boolean | Indicates 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|
| **Remark** | string | Reason 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|
| **UnsubscribeInfo** | string | When Purpose=3 and International=false, i.e., for domestic member promotion SMS templates, this field is required. Enumerated value: 【拒收请回复R】 |No|
| **Instruction** | string | Template Variable Property Description |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **TemplateId** | string | SMS Template ID (Work Order ID when applying for SMS template) |**Yes**|




## Example

### Request Example
    
```
https://api.scloudsg.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
    
```json
{
  "Action": "CreateUSMSTemplateResponse",
  "Message": "iUdpztgk",
  "RetCode": 0,
  "TemplateId": "edcONjeS"
}
```





