Notification

price

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

{
  "notificationPrice" : 3.15,
  "smsSegmentPrice" : 3.15,
  "emailPrice" : 0.15
}
Table 273. 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 274. /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" : ":Уваж: :Ф: :И: :О:! Ловите SMS-ку! Номер заказа: :ID:. Контактный телефон: :Tel:"
  },
  "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 275. /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_DOCTOR_APPOINTMENT_REMINDER" : {
    "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" : "Напоминание о записи на прием",
  "NOTIFICATION_BONUS" : "Сообщение о начислении бонусов",
  "GENERAL" : "Общие"
}

client notification types available

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

{
  "canSendPush" : true,
  "canSendEmail" : true,
  "canSendSms" : true,
  "canSendWhatsapp" : true,
  "email" : "test_notification_client@itigris.ru",
  "emailAccepted" : true
}
Table 276. response description
Path Type Description

canSendPush

Boolean

canSendPush

canSendEmail

Boolean

canSendEmail

canSendSms

Boolean

canSendSms

canSendWhatsapp

Boolean

canSendWhatsapp

email

String

Client email address

emailAccepted

Boolean

Client email accepted

send client notification

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

{
  "type" : "WHATSAPP",
  "message" : "Test Whatsapp message",
  "subject" : null
}
Table 277. request description
Path Type Description Constraints

type

String

[NOTIFICATION (push), EMAIL, SMS, WHATSAPP]

Must not be null

message

String

message

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 280 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[]