通知渠道
GET https://www.hostmonits.com/api/notification-handlers/
curl --request GET \
--url 'https://www.hostmonits.com/api/notification-handlers/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/notification-handlers/' \
--header 'Authorization: Bearer {api_key}' \
| 请求参数 | 详情 | 描述 |
|---|---|---|
| search | 选填 字符串 | 搜索关键词. |
| search_by | 选填 字符串 | 搜索匹配字段,可选值:name. |
| is_enabled | 选填 布尔型 | |
| type | 选填 字符串 | 搜索匹配字段,可选值:email, webhook, slack, discord, telegram, microsoft_teams, x, google_chat. |
| datetime_field | 选填 字符串 | 可选值:datetime, last_datetime |
| datetime_start | 选填 字符串 | 起始时间,格式 年-月-日 时:分:秒. |
| datetime_end | 选填 字符串 | 结束时间,格式 年-月-日 时:分:秒. |
| order_by | 选填 字符串 | 排序字段,可选值:notification_handler_id, datetime, last_datetime, name. |
| order_type | 选填 字符串 | 排序方式:ASC 升序,DESC 降序. |
| page | 选填 整型 | 数据页码,默认值 1. |
| results_per_page | 选填 整型 | 每页返回数据条数,可选值:10, 25, 50, 100, 250, 500, 1000,默认值 25. |
{
"data": [
{
"id": 1,
"type": "email",
"name": "Work email",
"settings": {
"email": "hey@example.com"
},
"is_enabled": true,
"last_datetime": null,
"datetime": "2026-06-22 06:47:24",
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://www.hostmonits.com/api/notification-handlers?page=1",
"last": "https://www.hostmonits.com/api/notification-handlers?page=1",
"next": null,
"prev": null,
"self": "https://www.hostmonits.com/api/notification-handlers?page=1"
}
}
GET https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}
curl --request GET \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"type": "email",
"name": "Work email",
"settings": {
"email": "hey@example.com"
},
"is_enabled": true,
"last_datetime": null,
"datetime": "2026-06-22 06:47:24",
}
}
POST https://www.hostmonits.com/api/notification-handlers
| 请求参数 | 详情 | 描述 |
|---|---|---|
| name | 必填 字符串 | - |
| type | 必填 字符串 | 可选值:email, webhook, slack, discord, telegram, microsoft_teams, x, google_chat |
| 选填 字符串 | 生效条件:type = email 邮箱地址 | |
| webhook | 选填 字符串 | 生效条件:type = webhook Webhook地址 |
| slack | 选填 字符串 | 生效条件:type = slack Slack Webhook地址 |
| discord | 选填 字符串 | 生效条件:type = discord Discord Webhook地址 |
| telegram | 选填 字符串 | 生效条件:type = telegram Telegram API令牌 |
| telegram_chat_id | 选填 字符串 | 生效条件:type = telegram Telegram会话ID |
| microsoft_teams | 选填 字符串 | 生效条件:type = microsoft_teams 微软Teams Webhook地址 |
| google_chat | 选填 字符串 | 生效条件:type = google_chat 谷歌聊天 Webhook地址 |
| x_consumer_key | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_consumer_secret | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_access_token | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_access_token_secret | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
curl --request POST \
--url 'https://www.hostmonits.com/api/notification-handlers' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'type=email' \
--form 'email=hello@example.com' \
--url 'https://www.hostmonits.com/api/notification-handlers' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'type=email' \
--form 'email=hello@example.com' \
{
"data": {
"id": 1
}
}
POST https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}
| 请求参数 | 详情 | 描述 |
|---|---|---|
| name | 选填 字符串 | - |
| type | 选填 字符串 | 可选值:email, webhook, slack, discord, telegram, microsoft_teams, x, google_chat |
| 选填 字符串 | 生效条件:type = email 邮箱地址 | |
| webhook | 选填 字符串 | 生效条件:type = webhook Webhook地址 |
| slack | 选填 字符串 | 生效条件:type = slack Slack Webhook地址 |
| discord | 选填 字符串 | 生效条件:type = discord Discord Webhook地址 |
| telegram | 选填 字符串 | 生效条件:type = telegram Telegram API令牌 |
| telegram_chat_id | 选填 字符串 | 生效条件:type = telegram Telegram会话ID |
| microsoft_teams | 选填 字符串 | 生效条件:type = microsoft_teams 微软Teams Webhook地址 |
| google_chat | 选填 字符串 | 生效条件:type = google_chat 谷歌聊天 Webhook地址 |
| x_consumer_key | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_consumer_secret | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_access_token | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| x_access_token_secret | 选填 字符串 | 生效条件:type = x Telegram API令牌 |
| is_enabled | 选填 布尔型 | - |
curl --request POST \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example new name' \
--form 'is_enabled=1' \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example new name' \
--form 'is_enabled=1' \
{
"data": {
"id": 1
}
}
DELETE https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}
curl --request DELETE \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \