All Products
Search
Document Center

Application Real-Time Monitoring Service:CreateOrUpdateWebhookContact

Last Updated:Jun 12, 2026

Membuat atau memodifikasi kontak peringatan Webhook.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

WebhookId

integer

No

ID kontak peringatan Webhook.

  • Biarkan parameter ini kosong untuk membuat kontak peringatan Webhook baru.

  • Tentukan parameter ini untuk mengubah informasi kontak peringatan Webhook yang ditentukan.

123

WebhookName

string

Yes

Nama kontak peringatan Webhook.

Webhook告警

Method

string

Yes

Metode permintaan HTTP.

  • Post

  • Get

Post

Url

string

Yes

URL dari metode permintaan yang ditentukan oleh Method.

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

BizHeaders

string

No

Header permintaan HTTP.

[{"Content-Type":"application/json;charset=utf-8"}]

BizParams

string

No

Parameter permintaan HTTP.

[{"content":"mike"}]

Body

string

No

Templat notifikasi yang dikirim saat peringatan dipicu. Parameter ini wajib diisi jika Method diatur ke Post. Anda dapat menggunakan placeholder $content untuk menentukan konten notifikasi. Konten tidak boleh melebihi 500 karakter. Untuk informasi lebih lanjut, lihat Deskripsi variabel templat notifikasi.

{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "告警时间":"{{ .startTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" }

RecoverBody

string

No

Templat notifikasi yang dikirim saat peringatan diselesaikan. Parameter ini wajib diisi jika Method diatur ke Post. Anda dapat menggunakan placeholder $content untuk menentukan konten notifikasi. Konten tidak boleh melebihi 500 karakter. Untuk informasi lebih lanjut, lihat Deskripsi variabel templat notifikasi.

{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "恢复时间":"{{ .endTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" }

Elemen respons

Element

Type

Description

Example

object

Skema Respons

RequestId

string

ID permintaan.

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

WebhookContact

object

Objek WebhookContact yang dikembalikan.

WebhookId

number

ID kontak peringatan Webhook.

123

WebhookName

string

Nama kontak peringatan Webhook.

Webhook告警

Webhook

object

Objek Webhook yang dikembalikan.

Method

string

The HTTP request method.

  • Post

  • Get

Post

Url

string

The URL of the request method.

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

BizHeaders

string

The HTTP request headers.

[{"Content-Type":"application/json;charset=utf-8"}]

BizParams

string

The parameters in the HTTP request.

[{"content":"mike"}]

Body

string

The alert notification template.

{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "告警时间":"{{ .startTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" }

RecoverBody

string

The notification template for clearing alerts.

{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "恢复时间":"{{ .endTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" }

Contoh

Respons sukses

JSONformat

{
  "RequestId": "16AF921B-8187-489F-9913-43C808B4****",
  "WebhookContact": {
    "WebhookId": 123,
    "WebhookName": "Webhook告警",
    "Webhook": {
      "Method": "Post",
      "Url": "https://oapi.dingtalk.com/robot/send?access_token=e1a049121******",
      "BizHeaders": "[{\"Content-Type\":\"application/json;charset=utf-8\"}]",
      "BizParams": "[{\"content\":\"mike\"}]",
      "Body": "{ \"告警名称\":\"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}\", \"集群名称\":\"{{ .commonLabels.clustername }} {{ end }}{{if eq \"app\" .commonLabels._aliyun_arms_involvedObject_kind }}\", \"应用名称\":\"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}\", \"通知策略\":\"{{ .dispatchRuleName }}\", \"告警时间\":\"{{ .startTime }}\", \"告警内容\":\"{{ for .alerts }} {{ .annotations.message }} {{ end }}\" }",
      "RecoverBody": "{ \"告警名称\":\"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}\", \"集群名称\":\"{{ .commonLabels.clustername }} {{ end }}{{if eq \"app\" .commonLabels._aliyun_arms_involvedObject_kind }}\", \"应用名称\":\"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}\", \"通知策略\":\"{{ .dispatchRuleName }}\", \"恢复时间\":\"{{ .endTime }}\", \"告警内容\":\"{{ for .alerts }} {{ .annotations.message }} {{ end }}\" }"
    }
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.