Application and subscriber statistics
getAppStats
Get the statistics of a specific app for a defined time period.
POST
https://cp.pushwoosh.com/json/1.3/getAppStats
Request parameters
Name | Required | Type | Description |
---|---|---|---|
auth | Yes | string | API access token from Pushwoosh Control Panel. |
application | Yes | string | Pushwoosh application code. |
datefrom | Yes | string | Start date and time of the reporting period. Format: Y-m-d H:i:s . |
dateto | Yes | string | End date and time of the reporting period. Format: Y-m-d H:i:s . |
Request example
{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "application": "XXXXX-XXXXX", // required. Pushwoosh application code "datefrom": "2013-06-04 00:00:00", // required. Date and time, start of the reporting period "dateto": "2013-06-07 00:00:00" // required. Date and time, end of the reporting period }}
Response example
{ "status_code": 200, "status_message": "OK", "response": { "request_id": "c93a202f439235f9adaaa06d651548ab" }}
Understanding the statistics
Statistics display registered actions for an application, device, or message within the specified timeframe.
Reports are automatically aggregated using the following rules:
- Yearly: If the period is longer than one year.
- Monthly: If the period is longer than one month.
- Daily: If the period is longer than one day.
- Hourly: If the period is longer than three hours.
- Minutely: In all other cases.
Action types
- Application Level:
_open_
,_install_
- Device Level:
_register_
,_unregister_
- Message Level:
_send_
,_open_
Response format
All statistics objects have the same format:
Field | Type | Description |
---|---|---|
formatter | string | Report scale: yearly, monthly, daily, hourly, minutely. |
rows | list | Contains report data for each registered action. |
Each report row contains:
Field | Type | Description |
---|---|---|
count | int | Number of registered actions. |
action | string | The type of registered action. |
datetime | string | Formatted date: Y-m-d H:i:s . |
Retrieving scheduled request results
Response body
Field | Type | Description |
---|---|---|
request_id | string | Scheduled request ID. Refer to /getResults for more details. |
Scheduled (/getResults) response body
Field | Type | Description |
---|---|---|
applications | dictionary | Statistics for applications. |
devices | dictionary | Statistics for devices. |
messages | dictionary | Statistics for messages. |
Example
{ "error": { "code": 0, "message": "OK" }, "json_data": { "applications": { "formatter": "hourly", "rows": [{ "count": 0, "action": "open", "datetime": "2013-06-06 00:00:00" }, { ... }] } }}
getApplicationSubscribersStats
Displays the app’s subscribers list grouped by the types of their devices.
POST
https://api.pushwoosh.com/json/1.3/getApplicationSubscribersStats
Request Body
Name | Required | Type | Description |
---|---|---|---|
auth | Yes | string | API access token from Pushwoosh Control Panel. |
application | Yes | string | Pushwoosh application code. |
Request example
{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "application": "XXXXX-XXXXX" // required. Pushwoosh application code }}
{ "status_code": 200, "status_message": "OK", "response": { "IOS": 1, "ANDROID": 1, "OSX": 0, "WINDOWS": 0, "AMAZON": 0, "SAFARI": 0, "FIREFOX": 0 }}
getSubscribersStatistics
Retrieves app subscribers stats for a time period.
POST
https://api.pushwoosh.com/api/v2/statistics/application/getSubscribersStatistics
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | API access token in the format: Key PKX.......NHg . |
Content-Type | Yes | string | Must be set to application/json . |
Request parameters
Name | Required | Type | Description |
---|---|---|---|
application_code | Yes | string | Pushwoosh application code. |
timestamp_from | Yes | string | Start date and time of the stats period (format: YYYY-MM-DD hh:mm:ss , UTC+0). |
timestamp_to | Yes | string | End date and time of the stats period (format: YYYY-MM-DD hh:mm:ss , UTC+0). |
Example request
{ "application_code": "12345-67890", "timestamp_from": "2022-08-01 00:00:00", "timestamp_to": "2022-09-01 00:00:00"}
Example response
{ "statistics": [{ "timestamp": "YYYY-MM-DD hh:mm:ss", // UTC+0 "platform": 1, "push_enabled": 100, "push_disabled": 100 }]}
Response codes
{ "statistics": [{ "timestamp": "YYYY-MM-DD hh:mm:ss", "platform": 1, "push_enabled": 100, "push_disabled": 100 }]}
Explanation: The request was successful, and the statistics are returned.
{ // Response}
Explanation: The request had invalid syntax or parameters.
{ // Response}
Explanation: The server encountered an error. Try again later.
{ // Response}
Explanation: Authentication failed. Check your API key or token.
{ // Response}
Explanation: Access denied for the specified app code.
{ // Response}
Explanation: The app code was not found or doesn’t exist.
Timestamp interval rules
Requested period | Interval in response |
---|---|
More than 1 year | 1 year |
1 year | 1 month |
1 month - 1 year | 1 day |
Less than 1 month | 1 hour |