Creates or modifies an alert contact.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes PutContact

The operation that you want to perform. Set the value to PutContact.

ContactName String Yes Alice

The name of the alert contact.

Describe String Yes ECS_Instance

The description of the alert contact.

Channels.SMS String No 1333333****

The phone number of the alert contact. After you add or modify a phone number, the recipient receives a text message that contains an activation link. The system adds the recipient to the list of alert contacts only after the recipient activates the phone number.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.

Channels.Mail String No test@aliyun.com

The email address of the alert contact. After you add or modify an email address, the recipient receives an email that contains an activation link. The system adds the recipient to the list of alert contacts only after the recipient activates the email address.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.

Channels.DingWebHook String No https://oapi.dingtalk.com/robot/send?access_token=7d49515e8ebf21106a80a9cc4bb3d247771305d52fb15d6201234565****

The webhook URL of the DingTalk chatbot.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.

Channels.AliIM String No Jim

The TradeManager ID of the alert contact.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.

Lang String No zh-cn

The language in which the alert information is displayed. Valid values:

  • zh-cn: simplified Chinese
  • en: English
Note If you do not specify a value for this parameter, Cloud Monitor identifies the language of the alert information based on the region of your Alibaba Cloud account.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Message String The Request is not authorization.

The returned message.

RequestId String 181C406E-9DE4-484C-9C61-37AE9A1A12EE

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

http(s)://[Endpoint]/?Action=PutContact
&ContactName=Alice
&Describe=ECS_Instance
&<Common request parameters>

Sample success responses

XML format

<PutContactResponse>
      <Code>200</Code>
      <RequestId>181C406E-9DE4-484C-9C61-37AE9A1A12EE</RequestId>
      <Success>true</Success>
</PutContactResponse>

JSON format

{
  "RequestId": "F7FA82F0-8627-441B-9B2B-8663617F36B9",
  "Success": true,
  "Code": "200"
}

Error codes

For a list of error codes, visit the API Error Center.