Ресурс

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)

GETorPOST/api/status-page-subscriber-notification-template/get-list

Список

Этот метод возвращает постраничный список ваших объектов «Subscriber Notification Template». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/status-page-subscriber-notification-template/get-list?skip=0&limit=10
Заголовки
Content-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"
    }
  ]
}
GETorPOST/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-item
Заголовки
Content-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"
}
POST/api/status-page-subscriber-notification-template/count

Количество

Возвращает количество ваших объектов «Subscriber Notification Template».

Необязательное тело запроса

Запрос количества

POST
/api/status-page-subscriber-notification-template/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "eventType": "Example event type"
  }
}

Ответ

{
  "count": 107
}
POST/api/status-page-subscriber-notification-template

Создать Subscriber Notification Template

Создаёт новый объект.

Запрос создания

POST
/api/status-page-subscriber-notification-template
Заголовки
Content-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"
}
PUT/api/status-page-subscriber-notification-template/:id

Обновить по ID

Обновляет объект по ID.

Альтернативные методы

Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:

POST/api/status-page-subscriber-notification-template/:id/update-item
GET/api/status-page-subscriber-notification-template/:id/update-item

Запрос обновления

PUT
/api/status-page-subscriber-notification-template/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "eventType": "Example event type",
    "notificationMethod": "Example notification method",
    "templateBody": "Example template body"
  }
}

Ответ

{}
DELETE/api/status-page-subscriber-notification-template/:id

Удалить по ID

Удаляет объект по ID.

Альтернативные методы

Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:

POST/api/status-page-subscriber-notification-template/:id/delete-item
GET/api/status-page-subscriber-notification-template/:id/delete-item

Запрос удаления

DELETE
/api/status-page-subscriber-notification-template/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY

Ответ

{}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения Subscriber Notification Template

  • Project Owner
  • Project Admin
  • Project Member
  • Read Status Page Subscriber Notification Template
  • Read All Project Resources

Права на создание

Нужны для создания Subscriber Notification Template

  • Project Owner
  • Project Admin
  • Project Member
  • Create Status Page Subscriber Notification Template

Права на обновление

Нужны для обновления Subscriber Notification Template

  • Project Owner
  • Project Admin
  • Project Member
  • Edit Status Page Subscriber Notification Template

Права на удаление

Нужны для удаления Subscriber Notification Template

  • Project Owner
  • Project Admin
  • Project Member
  • Delete Status Page Subscriber Notification Template