Creates a contact for webhook alerts.

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 CreateWebhook

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

ContactName String Yes Webhook alert

The name of the contact.

RegionId String Yes cn-hangzhou

The ID of the region.

Url String Yes https://oapi.dingtalk.com/robot/send?access_token=e1a049121ddbfce1ca963d115ef88cc7219583c4fb79fe6e398fbfb688******

The URL of the request method.

Method String No Post

The method of the HTTP request. Valid values:

  • Get
  • Post
HttpParams String No [{"name":"mike"}]

The parameters in the HTTP request.

HttpHeaders String No [{"Content-Type":"application/json"}]

The header of the HTTP request.

Body String No {"msg_type": "text","content": {"text": "$content"}}

The body of the HTTP request. This parameter is required if the Method parameter is set to Post. You can use the $content placeholder in the request body to export the alert information.

Response parameters

Parameter Type Example Description
ContactId String 48716

The ID of the contact for webhook alerts.

RequestId String 16AF921B-8187-489F-9913-43C808B4****

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateWebhook
&ContactName=Webhook alert
&RegionId=cn-hangzhou
&Url=https://oapi.dingtalk.com/robot/send?access_token=e1a049121ddbfce1ca963d115ef88cc7219583c4fb79fe6e398fbfb688******
&<Common request parameters>

Sample success responses

XML format

<CreateWebhookResponse>
  <RequestId>16AF921B-8187-489F-9913-43C808B4****</RequestId>
  <ContactId>48716</ContactId>
</CreateWebhookResponse>

JSON format

{
    "RequestId": "16AF921B-8187-489F-9913-43C808B4****",
    "ContactId": 48716
}