Updated on 2024-11-06 GMT+08:00

Modifying an SMS Template

Function

This API is used to modify template information. Currently, you can modify an SMS template that is rejected, change the name of an approved template, and withdraw the application for a template that is currently under review or a template with a signature that is under review and make modifications.

URI

PUT /v2/{project_id}/msgsms/templates/{id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Primary key ID of the template, which is the value of ID in Table 5.

project_id

Yes

String

Project ID. For details, see Obtaining Account, User, and Project Information.

Request Parameters

Table 2 Request header 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.

Table 3 Request body parameters

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:

  • CN: Chinese brackets
  • GB: English brackets ([])
    NOTICE:
    • Default value: CN
    • If the entered value is not within the preceding enumerated value range, the value is processed as CN.
    • This parameter is valid only when region is set to cn.

region

Yes

String

Region.

  • cn: Chinese mainland
  • intl: international

send_country

No

Array of integers

List of IDs of countries or regions to which SMSs are sent. Obtain this parameter from Table 4. This parameter is valid when region is set to intl.

sign_id

No

String

Signature ID. For details, see ID in Table 5. This parameter is valid only when region is set to cn.

template_content

Yes

String

Template content.

template_desc

No

String

Template description.

template_name

Yes

String

Template name.

template_type

No

String

Template type. Enumerated values:

  • VERIFY_CODE_TYPE: verification code
  • NOTIFY_TYPE: notification

    For international SMSs, the value is fixed to NOTIFY_TYPE.

universal_template

No

Integer

Whether the template is a general template.

  • 0: non-general template
  • 1: general template

flow_status

No

String

Process status.

  • Pending: to be submitted
  • Reviewing: to be reviewed

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Description

id

Primary key ID of the template.

template_name

Template name.

Request Example

PUT /v2/845ada5bc7444f1295cd517af0123da1/msgsms/templates/c3f641aa-4e87-4a70-b84d-a2d685599072 HTTP/1.1
Host: 100.85.***.***:30300
Content-Type: application/json
X-Auth-Token: ***
Content-Length: 311
 
{
       "app_id": "******9c-1a6b-4ee5-9651-5bca450694b3",
       "brackets": "GB",
       "region": "cn",
       "sign_id": "******58-e866-4b30-9ca5-a476a00e8775",
       "template_content": "Test",
       "template_name": "auto_test000",
       "template_type": "NOTIFY_TYPE",
       "universal_template": 0
}

Response Example

{
    "id": "******aa-4e87-4a70-b84d-a2d685599072",
    "template_name": "auto_test000"
}

Returned Values

Status Code

Description

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

500

System error