All Products
Search
Document Center

Application Real-Time Monitoring Service:CreateOrUpdateIMRobot

Last Updated:Nov 05, 2024

Creates or updates an IM chatbot.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
arms:CreateContactnone
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RobotIdlongNo

The ID of the IM chatbot.

Note If you do not specify the parameter, a new IM chatbot is created.
123
RobotNamestringYes

The name of the IM chatbot.

Chatbot name
TypestringYes

The type of the IM chatbot. Valid values:

  • dingding: DingTalk chatbot
  • wechat: WeCom chatbot
  • feishu: Lark chatbot
dingding
RobotAddressstringYes

The webhook URL of the IM chatbot.

https://oapi.dingtalk.com/robot/send?access_token=e1a049121******
DailyNocbooleanNo

Specifies whether to send daily statistics. Valid values:

  • false (default): Daily statistics are not sent.
  • true: Daily statistics are sent. If you set the value to true, the DailyNocTime parameter is required.
true
DailyNocTimestringNo

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
DingSignKeystringNo

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.

******
TokenstringNo

The token required to enable the Outgoing feature.

1656558719183be1245ab44********
EnableOutgoingbooleanNo

Specifies whether to enable the Outgoing feature.

true
CardTemplatestringNo

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

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

16AF921B-8187-489F-9913-43C808B4****
AlertRobotobject

The information about the IM chatbot.

RobotIdfloat

The ID of the IM chatbot.

123
RobotNamestring

The name of the IM chatbot.

Chatbot name
Typestring

The type of the IM chatbot. Valid values:

  • dingding: DingTalk chatbot
  • wechat: WeCom chatbot
dingding
RobotAddressstring

The webhook URL of the IM chatbot.

https://oapi.dingtalk.com/robot/send?access_token=e1a049121******
DailyNocboolean

Indicates whether daily statistics are sent. Valid values:

  • false (default): Daily statistics are not sent.
  • true: Daily statistics are sent.
true
DailyNocTimestring

The point in time at which the daily statistics are sent. 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
Tokenstring

The token required to enable the Outgoing feature.

1656558719183be1245ab44********
EnableOutgoingboolean

Indicates whether the Outgoing feature is enabled.

true
CardTemplatestring

The configurations of the alert card template.

{ "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 } ] }

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2024-07-30The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-07-20The request parameters of the API has changed. The response structure of the API has changedView Change Details
2022-07-08The request parameters of the API has changed. The response structure of the API has changedView Change Details