Notification

price

request
GET /api/v2/notification/price HTTP/1.1
response
HTTP/1.1 200 OK

{
  "notificationPrice" : 1000.0,
  "smsSegmentPrice" : 3.15,
  "emailPrice" : 1000.0
}
Table 267. response description
Path Type Description

notificationPrice

Number

Price for notification

smsSegmentPrice

Number

Price for one sms segment. To know segment length see GSM 03.38 standard

emailPrice

Number

Price for email

patterns

request
GET /api/v2/notification/patterns HTTP/1.1
response
HTTP/1.1 200 OK

[ {
  "id" : "FAMILY_NAME_RU",
  "pattern" : ":Ф:",
  "precalculatedLength" : 9
}, {
  "id" : "FIRST_NAME_RU",
  "pattern" : ":И:",
  "precalculatedLength" : 9
}, {
  "id" : "PATRONYMIC_NAME_RU",
  "pattern" : ":О:",
  "precalculatedLength" : 9
}, {
  "id" : "DEAR_RU",
  "pattern" : ":Уваж:",
  "precalculatedLength" : 9
}, {
  "id" : "BONUSES_BALANCE_RU",
  "pattern" : ":БалансБонусов:",
  "precalculatedLength" : 5
}, {
  "id" : "BONUSES_ACCUMULATED_RU",
  "pattern" : ":НачисленоБонусов:",
  "precalculatedLength" : 4
}, {
  "id" : "BONUSES_BURN_RU",
  "pattern" : ":СгораетБонусов:",
  "precalculatedLength" : 4
}, {
  "id" : "BONUSES_BURN_ON_RU",
  "pattern" : ":ДатаСгорания:",
  "precalculatedLength" : 10
}, {
  "id" : "CONTACT_LENS_DISCOUNT_END_ON_RU",
  "pattern" : ":АкцияМКЛ:",
  "precalculatedLength" : 10
}, {
  "id" : "FAMILY_NAME_EN",
  "pattern" : ":Surname:",
  "precalculatedLength" : 9
}, {
  "id" : "FIRST_NAME_EN",
  "pattern" : ":FirstName:",
  "precalculatedLength" : 9
}, {
  "id" : "DEAR_EN",
  "pattern" : ":Dear:",
  "precalculatedLength" : 9
}, {
  "id" : "ORDER_ID",
  "pattern" : ":ID:",
  "precalculatedLength" : 10
}, {
  "id" : "DEPARTMENT_TEL",
  "pattern" : ":Tel:",
  "precalculatedLength" : 10
}, {
  "id" : "BONUSES_BALANCE_EN",
  "pattern" : ":BonusBalance:",
  "precalculatedLength" : 5
}, {
  "id" : "BONUSES_ACCUMULATED_EN",
  "pattern" : ":AccruedBonuses:",
  "precalculatedLength" : 4
}, {
  "id" : "BONUSES_BURN_EN",
  "pattern" : ":BonusesBurn:",
  "precalculatedLength" : 4
}, {
  "id" : "BONUSES_BURN_ON_EN",
  "pattern" : ":BurningDate:",
  "precalculatedLength" : 10
}, {
  "id" : "CONTACT_LENS_DISCOUNT_END_ON_EN",
  "pattern" : ":CLOffer:",
  "precalculatedLength" : 10
} ]

list

Table 268. /api/v2/notification/settings/{notificationType}
Parameter Description

notificationType

Отвечает за тип настройки (SMS, EMAIL, GENERAL)

request example
GET /api/v2/notification/settings/SMS HTTP/1.1
response example
HTTP/1.1 200 OK

{
  "NOTIFICATION_ORDER" : {
    "text" : "Новый заказ"
  },
  "NOTIFICATION_DOCTOR_APPOINTMENT_REMINDER" : {
    "text" : "Ждем вас в :время:. :адрес:"
  },
  "NOTIFICATION_BONUS" : {
    "text" : "Вам зачислены бонусы!"
  },
  "GENERAL" : {
    "companySmsName" : "NoName"
  }
}

Возвращается Мапа вида <Type, <SettingCode, SettingValue>>

Type - к какому шаблону относится эта настройка:
  • GENERAL - общая настройка

  • NOTIFICATION_BONUS - настройка для шаблона о получении бонусов

  • NOTIFICATION_ORDER - настройка для шаблона о готовности заказа

SettingCode - название настройки:
  • text - текст сообщения,

  • subject - тема сообщения (для типа настройки EMAIL),

  • и т.д.;

SettingValue - значение настройки

Аналогичная Мапа передаётся в теле update

update

Table 269. /api/v2/notification/settings/{notificationType}
Parameter Description

notificationType

Отвечает за тип настройки (SMS, EMAIL, GENERAL)

request example
PUT /api/v2/notification/settings/SMS HTTP/1.1

{
  "GENERAL" : {
    "companySmsName" : "Test name"
  },
  "NOTIFICATION_BONUS" : {
    "text" : "Вам зачислены бонусы!"
  },
  "NOTIFICATION_ORDER" : {
    "text" : "Новый заказ"
  }
}

types

Возвращает все значения для Type

request
GET /api/v2/notification/settings/types HTTP/1.1
response
HTTP/1.1 200 OK

{
  "NOTIFICATION_ORDER" : "Уведомление о готовности заказа",
  "NOTIFICATION_DOCTOR_APPOINTMENT_REMINDER" : "ru.itigris.optima2.enums.setting.notification.SmsType.NOTIFICATION_DOCTOR_APPOINTMENT_REMINDER",
  "NOTIFICATION_BONUS" : "Сообщение о начислении бонусов",
  "GENERAL" : "Общие"
}

client notification types available

request
GET /api/v2/notification/client/999999990 HTTP/1.1
response
HTTP/1.1 200 OK

{
  "canSendPush" : false,
  "canSendEmail" : true,
  "canSendSms" : true
}
Table 270. response description
Path Type Description

canSendPush

Boolean

Whether push notifications can be sent to the client

canSendEmail

Boolean

Whether email notifications can be sent to the client

canSendSms

Boolean

Whether SMS notifications can be sent to the client

type

String

Preferred notification type (NOTIFICATION for push, EMAIL, SMS)

send client notification

request
POST /api/v2/notification/client/999999990 HTTP/1.1

{
  "type" : "SMS",
  "message" : "Test SMS message",
  "subject" : null,
  "price" : null
}
Table 271. request description
Path Type Description Constraints

type

String

Notification type (NOTIFICATION for push, EMAIL, SMS)

Must not be null

message

String

Notification message text

Must not be blank.
Size must be between 0 and 50000 inclusive

subject

String

Email subject (required only for EMAIL type)

Size must be between 0 and 100 inclusive

response
HTTP/1.1 200 OK
response description

Unresolved directive in index.adoc - include::/builds/itigris/optima-core/optima/optima-2-backend/target/generated-snippets/notification-client-send/response-fields.adoc[]