Получить статистику по ресурсам
Описание
Получить статистику по подпискам на конкретный ресурс.
URL-адрес
Метод: POST
https://example.com/api/v1.1/resources/get_counters
Параметры запроса
Параметр | Тип | Пример | Обязательный | Описание |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Да | API токен |
list_id | int | 1 | Да | Идентификатор базы данных |
id | int | 1 | Да | Идентификатор ресурса |
format | JSON object | "json" | Нет | Формат возвращаемых данных по умолчанию – "json" |
Пример запроса
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"list_id": 24,
"id": 5,
"format": "json"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<list_id>24</list_id>
<id>5</id>
<format>json</format>
</xml>
Пример ответа
- JSON
- XML
{
"data": [
{
"channel": "email",
"status": {
"all": 1336,
"subscribed": 925,
"unsubscribed": 0,
"complained": 0,
"hardbounced": 411,
"unconfirmed": 0,
"suspended": 0,
"invalid": 0,
"subscribed_sendable": 925,
"unconfirmed_sendable": 0
}
},
{
"channel": "sms",
"status": {
"all": 1336,
"subscribed": 0,
"unsubscribed": 0,
"complained": 0,
"hardbounced": 0,
"unconfirmed": 0,
"suspended": 0,
"invalid": 0,
"subscribed_sendable": 0,
"unconfirmed_sendable": 0
}
},
{
"channel": "push",
"status": {
"all": 1336,
"subscribed": 0,
"unsubscribed": 0,
"complained": 0,
"hardbounced": 0,
"unconfirmed": 0,
"suspended": 0,
"invalid": 0,
"subscribed_sendable": 0,
"unconfirmed_sendable": 0
}
}
],
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<channel>email</channel>
<status>
<all>1336</all>
<subscribed>925</subscribed>
<unsubscribed>0</unsubscribed>
<complained>0</complained>
<hardbounced>411</hardbounced>
<unconfirmed>0</unconfirmed>
<suspended>0</suspended>
<invalid>0</invalid>
<subscribed_sendable>925</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</data>
<data>
<channel>sms</channel>
<status>
<all>1336</all>
<subscribed>0</subscribed>
<unsubscribed>0</unsubscribed>
<complained>0</complained>
<hardbounced>0</hardbounced>
<unconfirmed>0</unconfirmed>
<suspended>0</suspended>
<invalid>0</invalid>
<subscribed_sendable>0</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</data>
<data>
<channel>push</channel>
<status>
<all>1336</all>
<subscribed>0</subscribed>
<unsubscribed>0</unsubscribed>
<complained>0</complained>
<hardbounced>0</hardbounced>
<unconfirmed>0</unconfirmed>
<suspended>0</suspended>
<invalid>0</invalid>
<subscribed_sendable>0</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Возвращаемые параметры
Параметр | Тип | Описание |
---|---|---|
data | array of objects | Массив полученных данных по каналам ресурса |
error | int | Код ошибки |
error_text | string | Текст ошибки |