tencent cloud

APIs

CreateAlarmNotice

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-06-10 15:03:26

1. API Description

Domain name for API request: cls.intl.tencentcloudapi.com.

This API is used to create a notification channel group with two configuration modes to choose from.

  1. Easy mode provides the most basic notification channel function. The following parameters are required:

  2. Type

  3. NoticeReceivers

  4. WebCallbacks

  5. Advanced mode: On the basis of easy mode, it supports setting rules, setting notification channels for different types of alarms, and escalating alarms. The following parameters are required:

  6. NoticeRules

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateAlarmNotice.
Version Yes String Common Params. The value used for this API: 2020-10-16.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Name Yes String Notification channel group name. Supports a maximum of 255 bytes. Does not support '
Tags.N No Array of Tag Tag description list. By specifying this parameter, you can bind multiple tags to the corresponding notification channel group. A maximum of 50 tag key-value pairs are supported, and there should not be duplicate key-value pairs.
Type No String [Easy mode] (Select either easy mode or alarm mode and configure corresponding parameters)
Alarm types that require sending notifications. Available values:
- Trigger - Alarm trigger
-Alarm Recovery
-All - Alarm trigger and alarm recovery
NoticeReceivers.N No Array of NoticeReceiver [Easy mode] (Select either easy mode or alarm mode and configure corresponding parameters)
Notification recipients
WebCallbacks.N No Array of WebCallback [Easy mode] (Select either easy mode or alarm mode and configure corresponding parameters)
Interface callback information (including WeCom, DingTalk, Lark).
NoticeRules.N No Array of NoticeRule [Advanced mode] (Choose between easy mode and alarm mode, and configure corresponding parameters)
Notification rules.
JumpDomain No String Query data link. It should start with http:// or https:// and should not end with /.
DeliverStatus No Integer Delivery log switch. Values are as follows:
1: Off (default value).
2: Enable
When the delivery log switch is enabled, the DeliverConfig parameter is required.
DeliverConfig No DeliverConfig Log shipping configuration parameter. It is required when DeliverStatus is enabled.
AlarmShieldStatus No Integer Login-free operation alarm switch. Values are as follows:
- 1: disabled.
-2: Enable (default value)
CallbackPrioritize No Boolean Unify the custom callback parameter settings.
-true: Use the custom callback parameters in the notification content template to override the request header and request body separately configured in the alarm policy.
-false: Prioritize using the request header and request body separately configured in the alarm policy.

3. Output Parameters

Parameter Name Type Description
AlarmNoticeId String Alarm template ID
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a Notification Channel Group (Easy Mode)

Includes two notification channels:
Use sms and phone to notify user Group (Group), user Group id is 27411.
Send notifications to the WeCom robot

Input Example

POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAlarmNotice
<Common request parameters>

{
    "Name": "demoAlarmNotice1",
    "Type": "All",
    "NoticeReceivers": [
        {
            "ReceiverType": "Group",
            "ReceiverIds": [
                27411
            ],
            "ReceiverChannels": [
                "Sms",
                "Phone"
            ],
            "StartTime": "00:00:00",
            "EndTime": "23:59:59",
            "NoticeContentId": "Default-zh",
            "Index": 1
        }
    ],
    "WebCallbacks": [
        {
            "Method": "POST",
            "CallbackType": "WeCom",
            "NoticeContentId": "Default-zh",
            "Url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx-xxxx-xxxx-xxxx-xxxx"
        }
    ],
    "NoticeRules": [],
    "DeliverStatus": 1,
    "AlarmShieldStatus": 2
}

Output Example

{
    "Response": {
        "AlarmNoticeId": "notice-b44d3a04-xxxx-4f9d-91f8-8abab903d885",
        "RequestId": "6ef60bec-0242-43af-bb20-270359fb54a7"
    }
}

Example2 Creating a Notification Channel Group (Advanced Mode)

It includes two processes: the alert first triggers notification process 1, and if unclaimed and unresolved after 10 minutes, it triggers notification process 2.
Step 1 includes 2 notification channels:
Use sms and phone to notify user Group (Group), user Group id is 27411.
Send notifications to the WeCom robot
Step 2 includes 1 notification channel

  • Use sms and phone calls to notify the user group (Uin) with user id 6318337.

Input Example

POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAlarmNotice
<Common request parameters>

{
    "Name": "demoAlarmNotice2",
    "NoticeRules": [
        {
            "NoticeReceivers": [
                {
                    "ReceiverType": "Group",
                    "ReceiverIds": [
                        27411
                    ],
                    "ReceiverChannels": [
                        "Sms",
                        "Phone"
                    ],
                    "StartTime": "00:00:00",
                    "EndTime": "23:59:59",
                    "NoticeContentId": "Default-zh"
                }
            ],
            "WebCallbacks": [
                {
                    "Method": "POST",
                    "CallbackType": "WeCom",
                    "NoticeContentId": "Default-zh",
                    "Url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx-xxxx-xxxx-xxxx-xxxx"
                }
            ],
            "Escalate": true,
            "Type": 1,
            "Interval": 10,
            "EscalateNotice": {
                "NoticeReceivers": [
                    {
                        "ReceiverType": "Uin",
                        "ReceiverIds": [
                            6318337
                        ],
                        "ReceiverChannels": [
                            "Sms",
                            "Phone"
                        ],
                        "StartTime": "00:00:00",
                        "EndTime": "23:59:59",
                        "NoticeContentId": "Default-zh"
                    }
                ],
                "WebCallbacks": [],
                "Escalate": false
            },
            "Rule": "{\"Value\":\"AND\",\"Type\":\"Operation\",\"Children\":[{\"Type\":\"Condition\",\"Value\":\"NotifyType\",\"Children\":[{\"Value\":\"In\",\"Type\":\"Compare\"},{\"Value\":\"[1,2]\",\"Type\":\"Value\"}]}]}"
        }
    ],
    "DeliverStatus": 1,
    "AlarmShieldStatus": 2
}

Output Example

{
    "Response": {
        "AlarmNoticeId": "notice-b44d3a04-xxxx-4f9d-91f8-8abab903d885",
        "RequestId": "6ef60bec-0242-43af-bb20-270359fb54a7"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
FailedOperation.Timeout Operation timed out
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameter.AlarmNoticeConflict The alarm notification template already exists.
MissingParameter Missing parameter.
OperationDenied.AccountDestroy The account has been terminated.
OperationDenied.AccountIsolate The account has overdue payments.
OperationDenied.AccountNotExists The account does not exist.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백