Get database statistics
Description
Get the statistics of subscriptions to a specific resource within the base.
URL
Method: POST
https://example.com/api/v1.1/databases/get_counters
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
id | int | 1 | Yes | Database ID |
resource_id | int | 1 | Yes | Resource ID |
format | int | "json" | No | Response data format By default – json |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 5,
"resource_id": 24,
"format": "json"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>5</id>
<resource_id>24</resource_id>
<format>json</format>
</xml>
Response example
- 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>
Response parameters
Parameter | Type | Description |
---|---|---|
data | array of objects | Array of received resource channel data |
error | int | Error code |
error_text | string | Error text |