Search Mail Template


Query the Email templates within this OU and the system OU.

This API is only available if 2.4 Cumulative Update 3 has been applied to your environment.

Request Format


GET https://{apigw-address}/notification-center-service/v2.0/email/templates

Request Parameters (URI)


Name Location (Path/Query) Required/Optional Data Type Description
orgId Query Required String The OU ID. How to get orgId >>
pageNo Query Optional Integer The request pages, starting from 1.
pageSize Query Optional Integer Lists the page size in a request. When not specified, 10 records are displayed per page by default. The maximum records per page is 1,000, but for optimal performance, it is recommended to have not more than 50 records per page.

Response Parameters


Name Data Type Description
data Items Struct and Pagination Struct

Items Struct


Name Data Type Description
orgId String The OU ID of the Email template.
templateName String The name of the Email template.
templateCode String The Email template ID.
content String The content of the Email template.
parameters Array The parameter list of the Email template.
subject String The subject of the Email template.

Samples

Request Sample


url: https://{apigw-address}/notification-center-service/v2.0/email/templates?action=get&orgId=yourOrgId&pageNo=2&pageSize=10
method: GET

Return Sample


{
    "code":"0",
    "msg":"OK",
    "submsg":"",
    "data":{
        "items":[
            {
                "orgId":"yourorgId",
                "templateName":"alarm-notification-1",
                "templateCode":"alarm-notification-1",
                "content":"$(INSTANCE) at $(START_TIME) has occurred $(DETAIL), please process ASAP.",
                "parameters":[
                    "INSTANCE",
                    "START_TIME",
                    "DETAIL"
                  ],
                "subject":"Alarm Notification"
            },
            {
                "orgId":"yourorgId",
                "templateName":"alarm-notification-2",
                "templateCode":"alarm-notification-2",
                "content":"$(EVENT) occurred at $(TIME).
                    $(DETAIL)
                    Please verify it ASAP.",
                "parameters":[
                    "EVENT",
                    "TIME",
                    "DETAIL"
                  ],
                "subject":"Alarm Notification"
            },
            {
                "orgId":"yourorgId",
                "templateName":"status-notification",
                "templateCode":"status-notification",
                "content":"$(SUMMARY)-$(START_TIME) Status: $(STATUS) $(DETAIL)",
                "parameters":[
                    "SUMMARY",
                    "START_TIME",
                    "STATUS",
                    "DETAIL"
                  ],
                "subject":"Status Notification"
            }
        ],
        "pagination":{
            "pageNo":"2",
            "pageSize":"10",
            "totalSize":"3"
        }
    },
    "requestId":""
}