Create Alert Content¶
Create a new alert content.
Prerequisite¶
Ensure the alert type that the alert content would belong to exists.
Request Format¶
POST https://{apigw-address}/event-service/v2.1/alert-contents?action=create
Request Parameters (URI)¶
Name  | 
Location (Path/Query)  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|---|
orgId  | 
Query  | 
Mandatory  | 
String  | 
The organization ID which the asset belongs to. How to get orgId>>  | 
Request Parameters (Body)¶
Name  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|
alertContent  | 
Mandatory  | 
GenerateContent Struct  | 
The details of the alert content. For more information, see generateContent Struct>>  | 
GenerateContent Struct  ¶
Name  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|
contentId  | 
Mandatory  | 
String  | 
The alert content ID.  | 
contentDesc  | 
Mandatory  | 
StringI18n  | 
Specify the alert content’s description in its respective locale’s language. For more details on the structure and locales supported, see Internationalized name struct>>  | 
modelId  | 
Mandatory  | 
String  | 
The model ID. How to get modelID>>  | 
alertTypeId  | 
Mandatory  | 
String  | 
The alert type ID.  | 
tags  | 
Optional  | 
Map  | 
User-defined tags. (The Key and Value are of String type.) For details, see How to use tags>>  | 
Response Parameters¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
data  | 
String  | 
The alert content ID.  | 
Samples¶
Request Sample¶
url: https://{apigw-address}/event-service/v2.1/alert-contents?action=create&orgId=yourOrgId
method: POST
requestBody:
{
    "alertContent": {
        "contentId": "planetTemperature",
        "contentDesc": {
            "defaultValue": "Grid is connected from converter",
            "i18nValue": {
                "en_US": "Grid is connected from converter",
                "zh_CN": "风机已并网"
            }
        },
        "modelId": "WindDev-E0",
        "alertTypeId": "9001",
        "tags": {
            "year": "2000",
            "author": "cshan"
        }
    },
  "action": "create"
}
Return Sample¶
{
    "code": 0,
    "msg": "OK",
    "requestId": "94e0e6e5-10dd-4fcb-a013-331d5869975a",
    "data": "planetTemperature"
}