Subscriber Notification Template
Manage custom notification templates for status page subscribers. These templates can be used to customize the notifications sent to subscribers via Email, SMS, Slack, Microsoft Teams, and Webhooks.
Модель Subscriber Notification Template
Свойства
- Имя
_id- Тип
- Object ID
- Описание
ID of this object
- Имя
createdAt- Тип
- Date
- Описание
Date and Time when the object was created.
- Имя
updatedAt- Тип
- Date
- Описание
Date and Time when the object was updated.
- Имя
project- Тип
- Project
- Описание
Relation to Project Resource in which this object belongs
- Имя
projectId- Тип
- Object IDОбязательно
- Описание
ID of your Project in which this object belongs
- Имя
templateName- Тип
- TextОбязательно
- Описание
A friendly name for this notification template
- Имя
templateDescription- Тип
- Long Text
- Описание
A description for this notification template
- Имя
eventType- Тип
- TextОбязательно
- Описание
The type of event this template is for (e.g., Incident Created, Announcement Created)
- Имя
notificationMethod- Тип
- TextОбязательно
- Описание
The notification method this template is for (Email, SMS, Slack, Microsoft Teams, Webhook)
- Имя
emailSubject- Тип
- Text
- Описание
The subject line for email notifications. Only used for Email notification method.
- Имя
templateBody- Тип
- HTMLОбязательно
- Описание
The template body content. For Email: HTML template. For SMS: Plain text. For Slack/Teams: Markdown.
- Имя
createdByUser- Тип
- User
- Описание
Relation to User who created this object (if this object was created by a User)
- Имя
createdByUserId- Тип
- Object ID
- Описание
User ID who created this object (if this object was created by a User)
/api/status-page-subscriber-notification-template/get-listСписок
Этот метод возвращает постраничный список ваших объектов «Subscriber Notification Template». По умолчанию на странице до десяти записей.
Необязательные query-параметры
limit- число
- Сколько объектов вернуть. По умолчанию 10, максимум 100
skip- число
- Сколько объектов пропустить (для пагинации)
Необязательное тело запроса
query- Чтобы фильтровать Subscriber Notification Template, укажите запрос здесь. Подробнее: написание запросов.
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
sort- По умолчанию сортировка по дате создания. Порядок можно изменить — см. раздел «Сортировка» в типах данных.
Запрос списка
POST/api/status-page-subscriber-notification-template/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"eventType": true,
"notificationMethod": true,
"projectId": true,
"templateBody": true,
"templateName": true
},
"query": {
"eventType": "Example event type"
},
"sort": {
"createdAt": -1
}
}Ответ
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "377dc6b0-28fe-11f1-b591-3fdcef396aba",
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
},
{
"_id": "377dc6b1-28fe-11f1-b591-3fdcef396aba",
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
},
{
"_id": "377dc6b2-28fe-11f1-b591-3fdcef396aba",
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
}
]
}/api/status-page-subscriber-notification-template/:id/get-itemПолучить по ID
Возвращает объект «Subscriber Notification Template» по идентификатору.
id- строка
- ID объекта
Необязательное тело запроса
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
Запрос одного объекта
POST/api/status-page-subscriber-notification-template/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"eventType": true,
"notificationMethod": true,
"projectId": true,
"templateBody": true,
"templateName": true
}
}Ответ
{
"_id": "377dc6b0-28fe-11f1-b591-3fdcef396aba",
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
}/api/status-page-subscriber-notification-template/countКоличество
Возвращает количество ваших объектов «Subscriber Notification Template».
Необязательное тело запроса
query- Чтобы фильтровать Subscriber Notification Template, укажите запрос здесь. Подробнее: написание запросов.
Запрос количества
POST/api/status-page-subscriber-notification-template/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"eventType": "Example event type"
}
}Ответ
{
"count": 107
}/api/status-page-subscriber-notification-templateСоздать Subscriber Notification Template
Создаёт новый объект.
Запрос создания
POST/api/status-page-subscriber-notification-templateContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
}
}Ответ
{
"_id": "377dc6b0-28fe-11f1-b591-3fdcef396aba",
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"templateBody": "Example template body",
"templateName": "Example template name"
}/api/status-page-subscriber-notification-template/:idОбновить по ID
Обновляет объект по ID.
Альтернативные методы
Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:
Запрос обновления
PUT/api/status-page-subscriber-notification-template/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"eventType": "Example event type",
"notificationMethod": "Example notification method",
"templateBody": "Example template body"
}
}Ответ
{}/api/status-page-subscriber-notification-template/:idУдалить по ID
Удаляет объект по ID.
Альтернативные методы
Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:
Запрос удаления
DELETE/api/status-page-subscriber-notification-template/:idContent-Type: application/json ApiKey: YOUR_API_KEY
Ответ
{}Права доступа
Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.
Права на чтение
Нужны для чтения Subscriber Notification Template
Project OwnerProject AdminProject MemberRead Status Page Subscriber Notification TemplateRead All Project Resources
Права на создание
Нужны для создания Subscriber Notification Template
Project OwnerProject AdminProject MemberCreate Status Page Subscriber Notification Template
Права на обновление
Нужны для обновления Subscriber Notification Template
Project OwnerProject AdminProject MemberEdit Status Page Subscriber Notification Template
Права на удаление
Нужны для удаления Subscriber Notification Template
Project OwnerProject AdminProject MemberDelete Status Page Subscriber Notification Template