This is an old version of the Statistics API. You can still use these methods, but we recommend using the Statistics API v2 to get the most out of your statistics.
getMsgStats (deprecated)
This method is deprecated. Please use the totalsByIntervals method instead.
{"request":{"auth":"yxoPUlwqm…………pIyEX4H",// required, API access token from Pushwoosh Control Panel"message":"xxxx-xxxxxxx-xxxxxx"// required, message code obtained in /createMessage request } }
Like every scheduled request, /getMsgStats request requires an additional /getResults request
{"request":{"auth":"yxoPUlwqm…………pIyEX4H",// required, API access token from Pushwoosh Control Panel "message": "xxxx-xxxxxxx-xxxxxx", // required, message code obtained from /createMessage request or Message History details
"platforms":[1,2,3,4,5] // optional, list of platform types. Please see /registerDevice for the complete list of platform types
} }
As every scheduled request, /getMsgPlatformsStats request requires an additional /getResults request.
{"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 } }
Statistic displays registered actions for application, device or message, for the timeframe specified.
Reports are automatically aggregated using the following rules: yearly > 1 year monthly > 1 month daily > 1 day hourly > 3 hours minutely in other cases.
Actions: Application Level: open, install
Device Level: register, unregister
Message level: send, open
All statistics objects have the same format:
Each of the report rows is a dictionary:
As every scheduled request, /getAppStats request requires an additional /getResults request.
{"request": {"auth":"yxoPUlwqm…………pIyEX4H",// required, API access token from Pushwoosh Control Panel"campaign":"XXXXX-XXXXX",// required, campaign ID"datefrom":"Y-m-d H:i:s",// required, date and time, start of the reporting period"dateto":"Y-m-d H:i:s"// required, date and time, end of the reporting period } }
As every scheduled request, /getCampaignStats request requires an additional /getResults request.
{"request" : {"auth":"yxoPUlwqm…………pIyEX4H",// required, API access token from Pushwoosh Control Panel"application":"XXXXX-XXXXX",// required, Pushwoosh application code"event":"Event name",// required, the name of Event exactly as created in Pushwoosh Control Panel"date_from":"2018-09-12",// required, start of the reporting period"date_to":"2018-09-12",// required, end of the reporting period"attributes": [ // optional {"name":"attributeName","operator":"EQ","values": ["val"] } ] }}
Like every scheduled request, /getEventStatistics request requires an additional /getResults request
{"status_code": 200,"status_message": "OK","response": {"request_id":"2702dd59b826e4a23b2f1af24de53108"//request_id for /getResults method }}
Example
{"request":{"auth":"yxoPUlwqm…………pIyEX4H",// required, API access token from Pushwoosh Control Panel"tag":"TAG_NAME",// required, tag name exactly as in Pushwoosh Control Panel "applications": ["APPLICATION_1", "APPLICATION_2", "APPLICATION_3"] // optional. Specify only when the tag is app specific.
} }
As every scheduled request, getTagStats request requires an additional /getResults request.
/getResults response:
{"status_code": 200,"status_message": "OK","response": {"fileName":"DIRECT_FILE_URL.csv"// direct link to the csv file }}
Received file is a CSV file with a semicolon ";" separator.