Get statistics on resource
Description
Get statistics on profile subscriptions in segment.
URL
Method: POST
https://example.com/api/v1.1/segments/get_counters
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
db_id | int | 3 | Yes, for dynamic segment | Database ID |
resource_id | int | 2 | Yes | Resource ID |
id | int | 1 | Yes | Segment ID |
format | int | "json" | No | Response data format By default – json |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"resource_id": 24,
"id": 7,
"format": "json"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<resource_id>24</resource_id>
<id>7</id>
<format>json</format>
</xml>
Response example
- JSON
- XML
{
"data": [
{
"channel": "email",
"status": {
"subscribed_sendable": 209,
"unconfirmed_sendable": 0
}
},
{
"channel": "push",
"status": {
"subscribed_sendable": 0,
"unconfirmed_sendable": 0
}
},
{
"channel": "sms",
"status": {
"subscribed_sendable": 108,
"unconfirmed_sendable": 0
}
}
],
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<channel>email</channel>
<status>
<subscribed_sendable>209</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</data>
<data>
<channel>push</channel>
<status>
<subscribed_sendable>0</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</data>
<data>
<channel>sms</channel>
<status>
<subscribed_sendable>108</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 |