Querying Details About a Message Template
Function
This API is used to query template details, including the template content.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/notifications/message_template/{message_template_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID.For details about how to obtain the project ID, see Obtaining the Project ID. |
message_template_id |
Yes |
String |
Specifies the unique resource ID of a template. To obtain the ID, see Querying Message Templates. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies a user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
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: default sms functionstage http and https |
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 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. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Specifies the request ID, which is unique. |
code |
String |
Specifies the error code. |
message |
String |
Describes the error message. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Specifies the request ID, which is unique. |
code |
String |
Specifies the error code. |
message |
String |
Describes the error message. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Specifies the request ID, which is unique. |
code |
String |
Specifies the error code. |
message |
String |
Describes the error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Specifies the request ID, which is unique. |
code |
String |
Specifies the error code. |
message |
String |
Describes the error message. |
Example Requests
Querying details about 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 |
400 |
Bad Request |
403 |
Unauthorized |
404 |
Not Found |
500 |
Internal Server Error |
Error Codes
See Error Codes.
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