Mailings
journal
GET /api/v2/mailings?sendMethod=SMS HTTP/1.1
Parameter | Description |
---|---|
|
EMAIL | SMS |
|
mailing topic (for email only) |
|
mailing content |
|
start on for creation date |
|
finish on for creation date |
|
HTTP/1.1 200 OK
{
"content" : [ {
"number" : 10000000002,
"createdOn" : "2023-01-02",
"topic" : null,
"content" : "Тестовая рассылка #2",
"totalNumberOfMessages" : 2,
"numberOfSentMessages" : 0,
"numberOfNotSentMessages" : 2,
"cost" : 0.0
}, {
"number" : 10000000001,
"createdOn" : "2023-01-01",
"topic" : null,
"content" : "Тестовая рассылка",
"totalNumberOfMessages" : 3,
"numberOfSentMessages" : 2,
"numberOfNotSentMessages" : 1,
"cost" : 4.0
} ],
"pageable" : {
"pageNumber" : 0,
"pageSize" : 10,
"sort" : {
"empty" : false,
"sorted" : true,
"unsorted" : false
},
"offset" : 0,
"paged" : true,
"unpaged" : false
},
"pageStatistics" : {
"count" : 2,
"cost" : 4.0
},
"totalStatistics" : {
"count" : 2,
"cost" : 4.0
},
"last" : true,
"totalElements" : 2,
"totalPages" : 1,
"first" : true,
"size" : 10,
"number" : 0,
"sort" : {
"empty" : false,
"sorted" : true,
"unsorted" : false
},
"numberOfElements" : 2,
"empty" : false
}
Path | Type | Description |
---|---|---|
|
|
mailing number |
|
|
mailing created date |
|
|
mailing topic |
|
|
mailing content |
|
|
total number of messages |
|
|
number of messages sent to the client |
|
|
number of messages not sent to the client |
|
|
mailing cost |
|
|
number of mailings for the selected period on the page |
|
|
mailings cost for the selected period on the page |
|
|
total number of mailings for the selected period |
|
|
total mailings cost for the selected period |
get
GET /api/v2/mailings/10000000001 HTTP/1.1
Parameter | Description |
---|---|
|
mailing id |
HTTP/1.1 200 OK
{
"sendMethod" : "SMS",
"type" : "GENERAL",
"number" : 10000000001,
"topic" : null,
"content" : "Тестовая рассылка",
"createdOn" : "2023-01-01",
"sentAt" : "11:00:00",
"managerFamilyName" : "Иванов",
"managerFirstName" : "Иван",
"managerPatronymicName" : null,
"sentCount" : 2,
"waitCount" : 1,
"notSentCount" : 0,
"totalCount" : 3,
"selectedFilterName" : null,
"autoNotificationWorkPeriod" : null,
"autoNotification" : false,
"cities" : [ "Москва", "Санкт-Петербург" ],
"shopNames" : [ "Первый магазин", "Второй магазин" ],
"manualFilter" : {
"familyName" : "Иванов",
"gender" : true,
"ageFrom" : 18,
"ageTo" : 30,
"birthdayFrom" : "2023-01-01",
"birthdayTo" : "2023-07-01",
"auto" : true,
"computer" : true,
"phoneAccepted" : false,
"mailAccepted" : false,
"hasOrders" : true,
"hasClientCard" : false,
"smsAccepted" : true,
"emailAccepted" : true,
"lastVisitFrom" : "2023-08-01",
"lastVisitTo" : "2023-08-02",
"cardSumFrom" : 10.0,
"cardSumTo" : 20.0,
"sumFrom" : 500.0,
"sumTo" : 1000.0,
"goodType" : "ACCESSORY",
"orderType" : "GLASSES"
}
}
Path | Type | Description |
---|---|---|
|
|
EMAIL | SMS |
|
|
GENERAL | AUTO_NOTIFICATION | REMINDER |
|
|
mailing number |
|
|
mailing topic |
|
|
mailing content |
|
|
mailing created date |
|
|
mailing sent time |
|
|
manager full name |
|
|
sent count |
|
|
wait count |
|
|
not sent count |
|
|
total count |
|
|
manualFilter |
|
|
family name |
|
|
gender |
|
|
age from |
|
|
birthday from |
|
|
birthday to |
|
|
auto |
|
|
computer |
|
|
phoneAccepted |
|
|
mail accepted |
|
|
has orders |
|
|
has client card |
|
|
sms accepted |
|
|
email accepted |
|
|
last visit from |
|
|
last visit to |
|
|
card sum from |
|
|
card sum to |
|
|
sum from |
|
|
sum to |
|
|
good type |
|
|
order type |
|
|
cities |
|
|
shop names |
|
|
selected filter name |
|
|
is auto notification mailing |
|
|
auto notification work period |
patterns
GET /api/v2/mailings/patterns HTTP/1.1
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" : "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
} ]
failed messages
GET /api/v2/mailings/10000000002/failed-messages HTTP/1.1
Parameter | Description |
---|---|
|
mailing id |
Parameter | Description |
---|---|
|
mailing status |
|
client phone number |
|
client full name |
HTTP/1.1 200 OK
{
"content" : [ {
"clientFamilyName" : "Bezos",
"clientFirstName" : "Jeff",
"clientPatronymicName" : "Americanson",
"clientPhoneNumber" : "+1321321321",
"status" : "SEND_ERROR"
}, {
"clientFamilyName" : "Пууманн",
"clientFirstName" : "Анна",
"clientPatronymicName" : "-",
"clientPhoneNumber" : "+79052380921",
"status" : "NO_PERMISSION"
} ],
"pageable" : {
"pageNumber" : 0,
"pageSize" : 10,
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"offset" : 0,
"paged" : true,
"unpaged" : false
},
"last" : true,
"totalElements" : 2,
"totalPages" : 1,
"first" : true,
"size" : 10,
"number" : 0,
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"numberOfElements" : 2,
"empty" : false
}
Path | Type | Description |
---|---|---|
|
|
clientFamilyName |
|
|
clientFirstName |
|
|
clientPatronymicName |
|
|
clientPhoneNumber |
|
|
status |
resend failed messages info
GET /api/v2/mailings/10000000002/failed-messages/resend-info HTTP/1.1
Parameter | Description |
---|---|
|
mailing id |
HTTP/1.1 200 OK
{
"balance" : 250003.15,
"cost" : 6.3
}
resend failed messages
PUT /api/v2/mailings/10000000002/failed-messages HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Parameter | Description |
---|---|
|
mailing id |
HTTP/1.1 200 OK
Возможные ошибки:
|
statuses
GET /api/v2/mailings/statuses HTTP/1.1
Parameter | Description |
---|---|
|
null|SUCCESSFULLY_SENT|WAITING_TO_SEND|FAILED_TO_SEND |
HTTP/1.1 200 OK
[ "STOPPED", "NON_SUFFICIENT_FUNDS", "QUEUE", "SEND_ERROR", "SEND_OK", "SEND_ATTEMPT", "NO_PERMISSION" ]
Path | Type | Description |
---|---|---|
|
|
array of mailing statuses |
filter description
GET /api/v2/mailings/10000000111/filter-description HTTP/1.1
Parameter | Description |
---|---|
|
mailing id |
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<table class="border">
<tr class="commonHeader">
<th style="text-align: center" colspan="2">Клиент</th>
</tr>
<tr>
<td class="specialTdInternal">Пол клиента</td>
<td class="specialTdInternal">Мужской</td>
</tr>
</table>
create mailing
POST /api/v2/mailings HTTP/1.1
{
"filterId" : 9999990001,
"filter" : {
"mailingType" : "SMS",
"ageFrom" : null,
"ageTo" : null,
"gender" : null,
"driver" : null,
"computer" : null,
"familyName" : null,
"cities" : null,
"departmentIds" : null,
"birthdayFrom" : null,
"birthdayTo" : null,
"lastVisitedOnFrom" : null,
"lastVisitedOnTo" : null,
"smsAccepted" : null,
"emailAccepted" : null,
"phoneAccepted" : null,
"mailAccepted" : null,
"orderType" : null,
"goodType" : null,
"ordersSumFrom" : null,
"ordersSumTo" : null,
"hasOrders" : null,
"hasClientCard" : null,
"cardSumFrom" : null,
"cardSumTo" : null
},
"topic" : null,
"content" : "Новая рассылка"
}
Path | Type | Description | Constraints |
---|---|---|---|
filterId |
Number |
ID готового фильтра |
|
topic |
String |
Заголовок сообщения (только для email) |
Length must be between 0 and 280 inclusive |
content |
String |
Тело сообщения |
Length must be between 0 and 50000 inclusive. |
filter |
Object |
Ручной фильтр |
Must not be null |
filter.mailingType |
String |
Тип рассылки [SMS,EMAIL] |
|
filter.ageFrom |
Number |
filter.ageFrom |
|
filter.ageTo |
Number |
filter.ageTo |
|
filter.gender |
String |
[MALE,FEMALE] |
|
filter.driver |
Boolean |
filter.driver |
|
filter.computer |
Boolean |
filter.computer |
|
filter.familyName |
String |
filter.familyName |
|
filter.cities |
Array |
filter.cities |
|
filter.departmentIds |
Array |
filter.departmentIds |
|
filter.birthdayFrom |
String |
filter.birthdayFrom |
|
filter.birthdayTo |
String |
filter.birthdayTo |
|
filter.lastVisitedOnFrom |
String |
filter.lastVisitedOnFrom |
|
filter.lastVisitedOnTo |
String |
filter.lastVisitedOnTo |
|
filter.smsAccepted |
Boolean |
filter.smsAccepted |
|
filter.emailAccepted |
Boolean |
filter.emailAccepted |
|
filter.phoneAccepted |
Boolean |
filter.phoneAccepted |
|
filter.mailAccepted |
Boolean |
filter.mailAccepted |
|
filter.orderType |
String |
[SALE,REPAIR,GLASSES,CONTACT_LENS,CHECK_VISION] |
|
filter.goodType |
String |
[ACCESSORY,CONTACT_LENS,EXTRAS,GLASSES,LENS,SUNGLASSES] |
|
filter.ordersSumFrom |
Number |
filter.ordersSumFrom |
|
filter.ordersSumTo |
Number |
filter.ordersSumTo |
|
filter.hasOrders |
Boolean |
filter.hasOrders |
|
filter.hasClientCard |
Boolean |
filter.hasClientCard |
|
filter.cardSumFrom |
Number |
filter.cardSumFrom |
|
filter.cardSumTo |
Number |
filter.cardSumTo |
HTTP/1.1 200 OK
stop mailing
PUT /api/v2/mailings/10000000001/stop HTTP/1.1
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK