Получить историю одного профиля
Описание
Получить историю действий одного профиля в сообщениях.
URL-адрес
Метод: POST
https://example.com/api/v1.1/subscribers/history_get
Параметры запроса
| Параметр | Тип | Пример | Обязательный | Описание |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Да | API токен |
| format | string | "json" | Нет | Формат возвращаемых данных (по умолчанию – "json") |
| list_id | Int | 1 | Да | Идентификатор базы данных |
| xxh | string | "0eb51aefd919f90a" | Нет, если есть matching | xxhash идентификатор профиля |
| matching | string | "email" "email_profile" "email_sub" "phone" "phone_sub" "profile_id" "push_sub" "custom" "custom_sub" "email_phone" "email_phone_sub" | Нет, если поиск по xxh | Режим поиска подписчика. По умолчанию – email. Для каждого типа матчинга в теле запроса необходимо передавать определенные поля. Подробнее об этих полях можно узнать здесь. |
| date_from | string | "2017-01-01" | Нет | Начало отчетного периода xxh.YYYYMMDD |
| date_to | string | "2017-12-31" | Нет | Конец отчетного периода xxh.YYYYMMDD |
Пример запроса
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"list_id": 20,
"xxh": "0eb51aefd919f90a"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<list_id>20</list_id>
<xxh>0eb51aefd919f90a</xxh>
</xml>
Пример ответа
- JSON
- XML
{
"data": [
{
"xxh": "9202595093f237d4",
"profile_id": "66f66973096b3b454bbbccec",
"email": "example@example.com",
"list_id": 66,
"action": "send",
"count": 1,
"datetime": "2024-09-27T15:52:57.004Z",
"message_id": 5,
"campaign_id": 137,
"event_id": "66f6aaa9da00a9db1c0b2683",
"smid": "uBAhiRBRQhARg7y489hr5F2b2aXMJaztFS7vM7DE1NGJhZWM5",
"campaign_name": "New astral campaign",
"message_name": "New template",
"subscription": {
"resource_id": 5,
"resource_name": "res1",
"channel": "email",
"email": "sub1@yandex.ru",
"priority": 0,
"status": "subscribed",
"custom_fields": {
"_device_type": "other"
},
"cats": []
},
"channel": "email",
"subscriptions": [
{
"resource_id": 5,
"resource_name": "res1",
"channel": "email",
"email": "sub1@yandex.ru",
"priority": 0,
"status": "subscribed",
"custom_fields": {
"_device_type": "other"
},
"cats": []
},
{
"resource_id": 5,
"resource_name": "res1",
"channel": "email",
"email": "sub2@yandex.ru",
"priority": 0,
"status": "subscribed",
"custom_fields": {
"_device_type": "mob"
},
"cats": []
}
]
}
],
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<item>
<xxh>9202595093f237d4</xxh>
<profile_id>66f66973096b3b454bbbccec</profile_id>
<email>example@example.ru</email>
<list_id>66</list_id>
<action>send</action>
<count>1</count>
<datetime>2024-09-27T15:52:57.004Z</datetime>
<message_id>5</message_id>
<campaign_id>137</campaign_id>
<event_id>66f6aaa9da00a9db1c0b2683</event_id>
<smid>uBAhiRBRQhARg7y489hr5F2b2aXMJaztFS7vM7DE1NGJhZWM5</smid>
<campaign_name>New astral campaign</campaign_name>
<message_name>New template</message_name>
<subscription>
<resource_id>5</resource_id>
<resource_name>res1</resource_name>
<channel>email</channel>
<email>sub1@yandex.ru</email>
<priority>0</priority>
<status>subscribed</status>
<custom_fields>
<_device_type>other</_device_type>
</custom_fields>
<cats/>
</subscription>
<channel>email</channel>
<subscriptions>
<subscription>
<resource_id>5</resource_id>
<resource_name>res1</resource_name>
<channel>email</channel>
<email>sub1@yandex.ru</email>
<priority>0</priority>
<status>subscribed</status>
<custom_fields>
<_device_type>other</_device_type>
</custom_fields>
<cats/>
</subscription>
<subscription>
<resource_id>5</resource_id>
<resource_name>res1</resource_name>
<channel>email</channel>
<email>sub2@yandex.ru</email>
<priority>0</priority>
<status>subscribed</status>
<custom_fields>
<_device_type>mob</_device_type>
</custom_fields>
<cats/>
</subscription>
</subscriptions>
</item>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>