Querying the Details of a Message Template
Function
This API is used to query template details, including the template content.
URI
GET /v2/{project_id}/notifications/message_template/{message_template_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Specifies the project ID. |
|
message_template_id |
Yes |
String |
Specifies the unique resource ID of a template. You can obtain it according to Querying the Message Template List. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
message_template_id |
String |
Specifies the template ID. |
|
message_template_name |
String |
Specifies the template name. |
|
protocol |
String |
Specifies the protocol supported by the template. The following protocols are supported:
|
|
tag_names |
Array of strings |
Specifies the variable list. The variable name will be quoted in braces ({}) in the template. When you use a template to send messages, you can replace the variable with any content. |
|
create_time |
String |
Specifies the time when the template was created. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format. |
|
update_time |
String |
Specifies the last time when the template was updated. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format. |
|
content |
String |
Specifies the template content. |
|
request_id |
String |
Specifies the request ID, which is unique. |
Example Requests
Querying the details of a message template
GET https://{SMN_Endpoint}/v2/{project_id}/notifications/message_template/57ba8dcecda844878c5dd5815b65d10f
null
Example Responses
Status code: 200
OK
{
"message_template_id" : "57ba8dcecda844878c5dd5815b65d10f",
"message_template_name" : "confirm_message",
"protocol" : "https",
"tag_names" : [ "topic_id_id4" ],
"create_time" : "2016-08-02T08:22:20Z",
"update_time" : "2016-08-02T08:22:25Z",
"content" : "(1/24)You are invited to subscribe to topic({topic_id_id4}). Click the following URL to confirm subscription:(If you do not want to subscribe to this topic, ignore this message.)",
"request_id" : "ba79ca8f794f4f50985ce7b98a401b47"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
Error Codes
See Error Codes.
Last Article: Querying the Message Template List
Next Article: Deleting a Message Template
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.