本介面用於建立告警推送的聯絡人。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
sysom:CreateAlertDestination |
create |
*全部資源。
|
無 | 無 |
請求文法
POST /api/v1/alertPusher/alert/createDestination HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| body |
object |
否 |
請求 Body。 |
|
| app_id |
string |
否 |
||
| app_secret |
string |
否 |
||
| group_id |
array |
否 |
||
|
string |
否 |
|||
| imbot |
boolean |
否 |
||
| name |
string |
否 |
告警聯絡人名稱。 |
test_name |
| params |
object |
否 |
告警聯絡人設定參數。 |
|
|
string |
否 |
電子郵件。 |
xxx@email.com |
|
| phone |
string |
否 |
電話。 |
1xxx |
| sec |
string |
否 |
機器人金鑰。 |
SECxxx |
| webhook |
string |
否 |
機器人連結。 |
https://oapi.dingtalk.com/robot/send?access_token=xxx |
| source |
string |
否 |
設定來源。 |
console |
| target |
string |
否 |
推送目標,目前僅支援釘釘機器人。 |
dingtalk |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| code |
string |
錯誤碼。 |
Success |
| data |
object |
回傳資料。 |
|
| createdAt |
integer |
建立時間。 |
1753669116286 |
| id |
integer |
策略 ID。 |
1 |
| name |
string |
策略名稱。 |
SysOM |
| params |
object |
告警聯絡人設定參數。 |
|
|
string |
電子郵件信箱。 |
xxx@email.com |
|
| phone |
string |
電話。 |
1xxx |
| sec |
string |
機器人金鑰。 |
SECxxx |
| webhook |
string |
機器人位址。 |
https://oapi.dingtalk.com/robot/send?access_token=xxx |
| source |
string |
設定來源。 |
console |
| target |
string |
推送目標,目前僅支援釘釘機器人。 |
dingtalk |
| uid |
string |
使用者 ID。 |
1222933234714935 |
| updatedAt |
integer |
更新時間。 |
1751254826285 |
| message |
string |
錯誤資訊。
|
SysomOpenAPIException: SysomOpenAPI.InvalidParameter Invalid params, should be json string or dict |
| requestId |
string |
請求 ID。 |
2D693121-C925-5154-8DF6-C09A8B369822 |
樣本
正常返回樣本
JSON格式
{
"code": "Success",
"data": {
"createdAt": 1753669116286,
"id": 1,
"name": "SysOM",
"params": {
"email": "xxx@email.com",
"phone": "1xxx",
"sec": "SECxxx",
"webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx"
},
"source": "console",
"target": "dingtalk",
"uid": "1222933234714935",
"updatedAt": 1751254826285
},
"message": "SysomOpenAPIException: SysomOpenAPI.InvalidParameter Invalid params, should be json string or dict",
"requestId": "2D693121-C925-5154-8DF6-C09A8B369822\n"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | Sysom.ServerError | Server error, please correct the code according to the error message. %s. | |
| 400 | SysomOpenAPI.ServerError | Server error, please correct the code according to the error message. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。