通知處理器
GET https://dmpilot.ru/api/notification-handlers/
curl --request GET \
--url 'https://dmpilot.ru/api/notification-handlers/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://dmpilot.ru/api/notification-handlers/' \
--header 'Authorization: Bearer {api_key}' \
參數 | 詳情 | 描述 |
---|---|---|
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": "2025-05-20 02:18:39"
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://dmpilot.ru/api/notification-handlers?&page=1",
"last": "https://dmpilot.ru/api/notification-handlers?&page=1",
"next": null,
"prev": null,
"self": "https://dmpilot.ru/api/notification-handlers?&page=1"
}
}
GET https://dmpilot.ru/api/notification-handlers/{notification_handler_id}
curl --request GET \
--url 'https://dmpilot.ru/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://dmpilot.ru/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": "2025-05-20 02:18:39"
}
}
POST https://dmpilot.ru/api/notification-handlers
參數 | 詳情 | 描述 |
---|---|---|
name | 必填 字串 | - |
type | 必填 字串 | 允許值: email , webhook , slack , discord , telegram , microsoft_teams |
選填 字串 | 可用於: type = email Email | |
webhook | 選填 字串 | 可用於: type = webhook Webhook URL |
slack | 選填 字串 | 可用於: type = slack Slack webhook URL |
discord | 選填 字串 | 可用於: type = discord Discord webhook URL |
telegram | 選填 字串 | 可用於: type = telegram Telegram API Token |
telegram_chat_id | 選填 字串 | 可用於: type = telegram Telegram聊天ID |
x_consumer_key | 選填 字串 | 可用於: type = x Telegram API Token |
x_consumer_secret | 選填 字串 | 可用於: type = x Telegram API Token |
x_access_token | 選填 字串 | 可用於: type = x Telegram API Token |
x_access_token_secret | 選填 字串 | 可用於: type = x Telegram API Token |
curl --request POST \
--url 'https://dmpilot.ru/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://dmpilot.ru/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://dmpilot.ru/api/notification-handlers/{notification_handler_id}
參數 | 詳情 | 描述 |
---|---|---|
name | 選填 字串 | - |
type | 選填 字串 | 允許值: email , webhook , slack , discord , telegram , microsoft_teams |
選填 字串 | 可用於: type = email Email | |
webhook | 選填 字串 | 可用於: type = webhook Webhook URL |
slack | 選填 字串 | 可用於: type = slack Slack webhook URL |
discord | 選填 字串 | 可用於: type = discord Discord webhook URL |
telegram | 選填 字串 | 可用於: type = telegram Telegram API Token |
telegram_chat_id | 選填 字串 | 可用於: type = telegram Telegram聊天ID |
x_consumer_key | 選填 字串 | 可用於: type = x Telegram API Token |
x_consumer_secret | 選填 字串 | 可用於: type = x Telegram API Token |
x_access_token | 選填 字串 | 可用於: type = x Telegram API Token |
x_access_token_secret | 選填 字串 | 可用於: type = x Telegram API Token |
is_enabled | 選填 布林值 | - |
curl --request POST \
--url 'https://dmpilot.ru/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://dmpilot.ru/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://dmpilot.ru/api/notification-handlers/{notification_handler_id}
curl --request DELETE \
--url 'https://dmpilot.ru/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://dmpilot.ru/api/notification-handlers/{notification_handler_id}' \
--header 'Authorization: Bearer {api_key}' \