Creates or updates an IM chatbot.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
arms:CreateContact | none |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RobotId | long | No | The ID of the IM chatbot. Note
If you do not specify the parameter, a new IM chatbot is created.
| 123 |
RobotName | string | Yes | The name of the IM chatbot. | Chatbot name |
Type | string | Yes | The type of the IM chatbot. Valid values:
| dingding |
RobotAddress | string | Yes | The webhook URL of the IM chatbot. | https://oapi.dingtalk.com/robot/send?access_token=e1a049121****** |
DailyNoc | boolean | No | Specifies whether to send daily statistics. Valid values:
| true |
DailyNocTime | string | No | The points in time at which the daily statistics are sent. Separate multiple points in time with commas (,). The points in time are in the HH:SS format. The information that ARMS sends at the specified points in time includes the total number of alerts generated on the current day, the number of cleared alerts, and the number of alerts to be cleared. | 09:30,17:00 |
DingSignKey | string | No | The signature key of DingTalk. If you specify a signature key, DingTalk authentication is performed by using the signature key. If you do not specify a signature key, a whitelist is used for authentication by default. The keyword of the whitelist is Alert. | ****** |
Token | string | No | The token required to enable the Outgoing feature. | 1656558719183be1245ab44******** |
EnableOutgoing | boolean | No | Specifies whether to enable the Outgoing feature. | true |
CardTemplate | string | No | The configurations of the alert card template. For more information about the parameters in the template, see the following section. | { "button": [ "claim", "close", "follow", "send_itsm", "block", "unResolvedIncident" ], "field": [ { "fieldName": "alarmName", "visible": true }, { "fieldName": "notificationPolicy", "visible": true }, { "fieldName": "alarmContent", "visible": true }, { "fieldName": "alarmTime", "visible": true }, { "fieldName": "seriesChart", "visible": true }, { "fieldName": "includeEvent", "visible": true }, { "fieldName": "assigned", "visible": true }, { "fieldName": "similarAlarm", "visible": true }, { "fieldName": "operator", "visible": true } ] } |
CardTemplate parameter description
Sample template:
{
"field": [
{
"fieldName": "alarmName",
"visible": false
},
{
"fieldName": "notificationPolicy",
"visible": true
},
{
"fieldName": "alarmContent",
"visible": true
},
{
"fieldName": "alarmTime",
"visible": true
},
{
"fieldName": "seriesChart",
"visible": true
},
{
"fieldName": "includeEvent",
"visible": true
},
{
"fieldName": "assigned",
"visible": true
},
{
"fieldName": "similarAlarm",
"visible": true
},
{
"fieldName": "operator",
"visible": true
}
],
"button": [
"claim",
"close",
"block",
"send_itsm",
"unResolvedIncident",
"follow"
]
}
-
fieldName: the name of the field in the alert card. The following fields are included:
- notificationPolicy: notification policy
- alarmName: alert name
- alarmContent: alert content
- AlarmTime: the time when the alert is triggered
- includeEvent: the number of events.
- assigned: the users to which notifications are sent
- operator: the user who handles the alert
- similarAlarm: the last similar alert
- seriesChart: the trend chart of the alert metrics
-
visible: specifies whether the content of the corresponding field on the alert card is visible.
- true: visible
- false: invisible
-
button: the setting button in the card. The parameter order corresponds to the card button order. The following buttons are available:
- claim: claims alerts
- close: clears alerts
- follow: follows alerts
- send_itsm: pushes alerts
- block: blocks alerts
- unResolvedIncident: unclears alerts
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "16AF921B-8187-489F-9913-43C808B4****",
"AlertRobot": {
"RobotId": 123,
"RobotName": "Chatbot name\n",
"Type": "dingding",
"RobotAddress": "https://oapi.dingtalk.com/robot/send?access_token=e1a049121******",
"DailyNoc": true,
"DailyNocTime": "09:30,17:00",
"Token": "1656558719183be1245ab44********\n",
"EnableOutgoing": true,
"CardTemplate": "{ \"button\": [ \"claim\", \"close\", \"follow\", \"send_itsm\", \"block\", \"unResolvedIncident\" ], \"field\": [ { \"fieldName\": \"alarmName\", \"visible\": true }, { \"fieldName\": \"notificationPolicy\", \"visible\": true }, { \"fieldName\": \"alarmContent\", \"visible\": true }, { \"fieldName\": \"alarmTime\", \"visible\": true }, { \"fieldName\": \"seriesChart\", \"visible\": true }, { \"fieldName\": \"includeEvent\", \"visible\": true }, { \"fieldName\": \"assigned\", \"visible\": true }, { \"fieldName\": \"similarAlarm\", \"visible\": true }, { \"fieldName\": \"operator\", \"visible\": true } ] }"
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-30 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2022-07-20 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2022-07-08 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |