« Back to Documentation Overviewget_contacts_subscription_stats
Section: Contacts
Version: 1.5.0
Get contacts subscription stats aggregated by time period, campaign and contact’s origin.
Conditions:
- campaigns / get_campaigns (optional) – Get statistics only for given campaigns. Uses OR logic. If those params are not given statistics are returned from all campaigns on the account. Check IDs in conditions for detailed explanation.
- created_on (optional) – Use time operators to narrow down search results to specific contact creation date. Multiple operators are allowed and logic AND is used so date range can also be expressed.
- grouping (optional) – Determines period of time by which stats are aggregated. Allowed values are: hourly (result keys in "YYYY-MM-DD HH" format), daily (result keys in "YYYY-MM-DD" format), monthly (result keys in "YYYY-MM" format) and yearly (result keys in "YYYY" format). Default is daily.
Warning: Graduation may not be continuous. Given time period is present in result only if it has at least one positive value in it.
Parameters
|
---|
string | API_KEY |
object | array | campaigns | string | CAMPAIGN_ID | string | CAMPAIGN_ID |
| object | get_campaigns | object | name | string | CONTAINS | my_campaign_% |
|
| object | created_on | | string | grouping | monthly |
|
Return Value
|
---|
object | 2010-01-01 | object | CAMPAIGN_ID | integer | iphone | 8 | integer | www | get_contacts_subscription_stats_www_0_integer | integer | sale | get_contacts_subscription_stats_sale_0_integer | integer | leads | 64 | integer | forward | get_contacts_subscription_stats_forward_0_integer | integer | panel | get_contacts_subscription_stats_panel_0_integer | integer | api | 512 | integer | import | 16 | integer | email | get_contacts_subscription_stats_email_0_integer | integer | survey | get_contacts_subscription_stats_survey_0_integer | integer | copy | 1 | integer | landing_page | get_contacts_subscription_stats_landing_page_0_integer |
|
|
object | 2010-01-02 | object | CAMPAIGN_ID | integer | iphone | get_contacts_subscription_stats_iphone_0_integer | integer | www | get_contacts_subscription_stats_www_0_integer | integer | sale | get_contacts_subscription_stats_sale_0_integer | integer | leads | 128 | integer | forward | get_contacts_subscription_stats_forward_0_integer | integer | panel | get_contacts_subscription_stats_panel_0_integer | integer | api | 2048 | integer | import | get_contacts_subscription_stats_import_0_integer | integer | email | get_contacts_subscription_stats_email_0_integer | integer | survey | get_contacts_subscription_stats_survey_0_integer | integer | copy | get_contacts_subscription_stats_copy_0_integer | integer | landing_page | get_contacts_subscription_stats_landing_page_0_integer |
|
|
Example Request JSON
[
"API_KEY",
{
"campaigns": [
"CAMPAIGN_ID",
"CAMPAIGN_ID"
],
"get_campaigns": {
"name": {
"CONTAINS": "my_campaign_%"
}
},
"created_on": {
"OPERATOR": "value"
},
"grouping": "monthly"
}
]
Example Response JSON
{
"2010-01-01": {
"CAMPAIGN_ID": {
"iphone": 8,
"www": 0,
"sale": 0,
"leads": 64,
"forward": 0,
"panel": 0,
"api": 512,
"import": 16,
"email": 0,
"survey": 0,
"copy": 1,
"landing_page": 0
}
},
"2010-01-02": {
"CAMPAIGN_ID": {
"iphone": 0,
"www": 0,
"sale": 0,
"leads": 128,
"forward": 0,
"panel": 0,
"api": 2048,
"import": 0,
"email": 0,
"survey": 0,
"copy": 0,
"landing_page": 0
}
}
}
API-wide Errors
|
---|
API key verification failed
| API key verification failed |
API client IP not allowed
| API client IP not allowed |
Invalid params
| Attribute params must be reference to hash |