Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint1YesDatabase ID
resource_idint1YesResource ID
formatint"json"NoResponse data format
By default – json

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 5,
"resource_id": 24,
"format": "json"
}

Response example

{
"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"
}

Response parameters

ParameterTypeDescription
dataarray of objectsArray of received resource channel data
errorintError code
error_textstringError text