Creating an SMS Template
Function
This API is used to create a template.
URI
POST /v2/{project_id}/msgsms/templates
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining Account, User, and Project Information. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Request body parameter type. This parameter must be set to application/json. |
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_id |
Yes |
String |
Primary key ID of the application. For details, see ID in Table 5. |
brackets |
No |
String |
Bracket type. Enumerated values:
|
region |
Yes |
String |
Region.
|
send_country |
No |
Array of integers |
List of IDs of countries or regions to which SMSs are sent. It can be obtained from Table 4. This parameter is mandatory when region is set to intl. |
sign_id |
No |
String |
Primary key ID of the signature. For details, see ID in Table 5. This parameter is valid only when the region is the Chinese mainland and the value of universal_template is not 1. |
template_content |
Yes |
String |
Template content. Read Template and Variable Specifications and Sample Template carefully before configuring this parameter. |
template_desc |
No |
String |
Template description. |
template_name |
Yes |
String |
Template name. |
template_type |
Yes |
String |
Template type. This parameter is valid only when the region is the Chinese mainland and the value of universal_template is 1. If universal_template is set to 0, the template type uses the associated signature type. Enumerated values:
For international SMSs, the value is fixed to NOTIFY_TYPE. |
universal_template |
No |
Integer |
Whether the template is a general template. When the input parameter is set to 1, the sign_id field is invalid.
|
Response Parameters
Parameter |
Type |
Description |
---|---|---|
id |
String |
Primary key ID of the template. |
template_name |
String |
Template name. |
Request Example
POST /v2/845ada5bc7444f1295cd517af0123da1/msgsms/templates Host: 100.85.***.***:30300 Content-Type: application/json X-Auth-Token: **** Content-Length: 308 { "app_id": "******9c-1a6b-4ee5-9651-5bca450694b3", "brackets": "GB", "region": "cn", "sign_id": "******10-c3fb-427e-965c-a98ae844c5bd", "template_content": "Test", "template_name": "auto_test789", "template_type": "NOTIFY_TYPE", "universal_template": 0 }
Response Example
{ "id": "******27-37eb-4229-bee9-0eba4d8a897f", "template_name": "auto_test789" }
Returned Values
Status Code |
Description |
---|---|
200 |
OK |
201 |
Created |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
System error |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot